Closed asmodeus812 closed 3 months ago
Can't reproduce, works fine for me using a keymap like:
keymap.set({"n", "v"}, "<a-CR>", vim.lsp.buf.code_action, { buffer = args.buf })
I think this wouldn't even require any of the client extensions of nvim-jdtls, but is possible with plain neovim core+jdtls.
Hm i see a completely different set of actions when i trigger this one with { context = { only = { "refactor" } }, apply = false }
is that not a refactor or quickfix, why is it visible only with the non opts call version of code_action ?
I also see the option with keymap.set("v", "<leader>r", "<Cmd>lua vim.lsp.buf.code_action { context = { only = {'refactor'}}}<CR>", { buffer = args.buf })
One thing that came to mind: Maybe couble check the client capabilities. textDocument.codeAction.codeActionLiteralSupport.codeActionKind.valueSet
should contain:
"",
"quickfix",
"refactor",
"refactor.extract",
"refactor.inline",
"refactor.rewrite",
"source",
"source.organizeImports",
"source.generate.toString",
"source.generate.hashCodeEquals"
LSP client configuration
Eclipse.jdt.ls version
1.33
Steps to Reproduce
When executing vim.lsp.buf.code_actions()
Expected Result
Extract to method is visible in the actions
Actual Result
Extract to method is applicable for selected range. Optionally ask the user to enter the new method name