Skip to content

Instantly share code, notes, and snippets.

@PatOConnor43
Created September 24, 2020 15:24
Show Gist options
  • Save PatOConnor43/88156409b03794f5e05280dbfb42faa6 to your computer and use it in GitHub Desktop.
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()`
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;
})
@ninjawithaneedle
Copy link

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