Closed chaozwn closed 6 months ago
:lua vim.lsp.buf.code_action({ context = { only = { "source" } } })
Or use :lua vim.lsp.buf.code_action({ context = { only = { "source", "refactor", "quickfix" } } })
to see all of the available code actions.
:lua vim.lsp.buf.code_action({ context = { only = { "source" } } })
Or use
:lua vim.lsp.buf.code_action({ context = { only = { "source", "refactor", "quickfix" } } })
to see all of the available code actions.
Thank you for your response, but I hope that these options are available by default in the buffer using code action, just like Move to a new File
.
Sorry, I prefer not to implement this on server side, as explained in https://github.com/microsoft/language-server-protocol/issues/1554. For compatibility, we should only return standard quickfix actions on request without any provided kinds, and this is also what most of the lsp servers does. User should implement this on client side.
How to add a global fix to 'remove all unused imports' to code actions, like
typescript-tools.nvim
.