-
-
Notifications
You must be signed in to change notification settings - Fork 211
Open
Description
Hi there
I'm setting up Neovim with nvim-lspconfig
, and I'm getting an issue when trying to enable the Dart language server (dartls
). When I start Neovim, I get the following error:
.../share/nvim/lazy/mason.nvim/lua/mason-registry/init.lua:80: Cannot find package "dartls"
Here's what I’ve done so far:
- I’m using mason.nvim and mason-lspconfig.nvim to manage language servers.
- I have not manually installed
dartls
but expected it to be installed automatically as part of my setup. - I checked the Mason package registry and couldn’t find a
dartls
package listed (so this is the problem, Mason can not recognize that something called dartls exists).
I am using kickstart, take a look here at their setup, I added dartls
as it is the one that can be found after running :help lspconfig-all
:
So any suggestions on how to make this run
Note: For me, I realized that I can manually setup dart lsp to work without need to use mason-lspconfig
by using this code:
require("lspconfig").dartls.setup({
cmd = { "path/to/dart", "language-server", "--protocol=lsp" },
filetypes = { "dart" },
init_options = {
closinglabels = true,
flutteroutline = true,
onlyanalyzeprojectswithopenfiles = true,
outline = true,
suggestfromunimportedlibraries = true,
},
-- root_dir = root_pattern("pubspec.yaml"),
settings = {
dart = {
completefunctioncalls = true,
showtodos = true,
},
},
on_attach = function(client, bufnr)
end,
})
But I am making this issue for future users how want to use mason-lspconfig
without manually doing this.
Metadata
Metadata
Assignees
Labels
No labels