Created
September 24, 2020 15:24
-
-
Save PatOConnor43/88156409b03794f5e05280dbfb42faa6 to your computer and use it in GitHub Desktop.
A small gist to show a dartls setup function to allow all the codeactions. These can be shown with `:lua vim.lsp.buf.code_action()`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local dart_capabilities = vim.lsp.protocol.make_client_capabilities() | |
dart_capabilities.textDocument.codeAction = { | |
dynamicRegistration = false; | |
codeActionLiteralSupport = { | |
codeActionKind = { | |
valueSet = { | |
"", | |
"quickfix", | |
"refactor", | |
"refactor.extract", | |
"refactor.inline", | |
"refactor.rewrite", | |
"source", | |
"source.organizeImports", | |
}; | |
}; | |
}; | |
} | |
nvim_lsp.dartls.setup({ | |
on_attach = dart_attach; | |
init_options = { | |
onlyAnalyzeProjectsWithOpenFiles = true, | |
suggestFromUnimportedLibraries = false, | |
closingLabels = true, | |
}; | |
capabilities = dart_capabilities; | |
}) |
After reinstalling dart, flutter and neovim one by one, I found that it was a problem with the version of neovim I was using. Upgrading that to the latest nightly has fixed the problem. Thanks for the help.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The language server is running. Except code actions, everything is working fine. I tried setting this:
Now, I can see code actions. But, only a few of them. Like
Thanks for the tips. I'll keep debugging