-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jdtls: -32601: No delegateCommandHandler for java.action.generateConstructorsPrompt #2774
Comments
You should only see that if the client sets extendedClientCapabilities.generateConstructorsPromptSupport to true. And if you set that, the client is expected to handle the command on the client side. It looks like https://github.com/weilbith/nvim-code-action-menu/ doesn't handle client commands at all. You'll have to use the builtin |
@mfussenegger thanks for help! I tried to set this param in ftplugin/java.lua in my nvim config and use sending command script on java file and still receive this error. I don't understand how to set it up. My settings in ftplugin: ...
local extendedClientCapabilities = jdtls.extendedClientCapabilities
extendedClientCapabilities.generateConstructorsPromptSupport = true
local config = {
cmd = get_cmd(),
capabilities = capabilities,
root_dir = require('jdtls.setup').find_root({'.git', 'mvnw', 'gradlew'}),
settings = {
['java.settings.url'] = java_settings_url,
java = {
signatureHelp = {enabled = true},
contentProvider = {preferred = "fernflower"},
configuration = {
runtimes = {
{
name = 'JavaSE-11',
path = jdk_dir
}
}
}
}
},
on_attach = on_attach,
init_options = {
extendedClientCapabilities = extendedClientCapabilities
},
}
jdtls.start_or_attach(config)
script I call on file local command = {
arguments = { {
context = {
diagnostics = {}
},
range = {
["end"] = {
character = 0,
line = 25
},
start = {
character = 0,
line = 25
}
},
textDocument = {
uri = "file:///Users/tukaloff/git/media-fs-transfer-tool/src/main/java/com/tukaloff/mediafstransfertool/FileService.java"
}
} },
command = "java.action.generateConstructorsPrompt",
title = "Generate Constructors..."
}
vim.lsp.buf.execute_command(command) |
See https://github.com/neovim/neovim/blob/4e4ad4312e6b3755a2114ab81c62033e6bc616fe/runtime/lua/vim/lsp.lua#L1669 for how neovim core handles commands |
On
vim.lsp.buf.execute_command
forjava.action.generateConstructorsPrompt
return exception:but works for
vim.lsp.buf.code_action
The text was updated successfully, but these errors were encountered: