-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
java lsp not work #97
Comments
I can reproduce the issue. From what I saw, JDTLS does not send any signature help back to neovim. What I got is {
bufnr = 1,
client_id = 1,
method = "textDocument/signatureHelp"
} I tried to send If it is not issue from jdtls, then there maybe something wrong with neovim lsp framework. |
ok thanks |
I believe jdtls disable signature by default, please check these threads on how to turn it on eclipse-jdtls/eclipse.jdt.ls#1436 and |
Yes, I have solved it. Now it works normally. thanks |
For document purpose: local jdtcfg = {
settings = {
java = {signatureHelp = {enabled = true}, contentProvider = {preferred = 'fernflower'}}
},
on_init = function(client)
if client.config.settings then
client.notify('workspace/didChangeConfiguration', {settings = client.config.settings})
end
end
}
require('lspconfig').setup(jdtcfg)
Alsp please make sure the $JDTLS_HOME and $JAVA_HOME is correct. |
can you please how would this look like with the following:
|
Is your java lsp up and running? what is the output of |
this is what it says
|
I do not use java. But from my earlier comments, it seems jdtls disabled the signature by default. You might need to set up lspconfig like this: local jdtcfg = {
settings = {
java = {signatureHelp = {enabled = true}, contentProvider = {preferred = 'fernflower'}}
},
on_init = function(client)
if client.config.settings then
client.notify('workspace/didChangeConfiguration', {settings = client.config.settings})
end
end
}
require('lspconfig').setup(jdtcfg) |
so something like this doesn't work:
|
I wish I could offer more help but I spent half an hour without even getting jdtls running. I checked the behaviour of vscode and it also failed to get lsp setup and do some simple tasks like auto-complete. |
no worries @ray-x I appreciate your help and the work you put into this tool! 🤜🤛 |
For future readers, and for reference, here's how a
I set up a lot of variables defined on my configuration for make it more convenient, but the important point is just the "skeleton" of the configuration. I just use Java only professionaly, and I am able to use it every day without issues in my job, so I really hope that this could help anybody in the same situation EDIT: I download everything related with |
thanks for sharing @TheRustifyer |
- Added custom Java settings for improved LSP support. - Enabled single file support. - Updated import exclusions and content provider preferences. - Enabled Gradle and Maven import settings. - Included source method declarations in symbols. - Enabled rename functionality. References: - ray-x/lsp_signature.nvim#97 - https://github.com/mfussenegger/nvim-jdtls - https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request - https://stackoverflow.com/questions/74844019/neovim-setting-up-jdtls-with-lsp-zero-mason
- Added custom Java settings for improved LSP support. - Enabled single file support. - Updated import exclusions and content provider preferences. - Enabled Gradle and Maven import settings. - Included source method declarations in symbols. - Enabled rename functionality. References: - ray-x/lsp_signature.nvim#97 - https://github.com/mfussenegger/nvim-jdtls - https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request - https://stackoverflow.com/questions/74844019/neovim-setting-up-jdtls-with-lsp-zero-mason
hi, I followed the plugin and it works fine in lua but not work for java。Please help me to see if the configuration is wrong
require'lsp_signature'.setup {
bind = true,
floating_window = true,
hint_enable = false,
hint_prefix = "",
extra_trigger_chars = {"(", ","},
hi_parameter = "Search",
float_window_above_cur_line = false,
log_path = vim.fn.expand("$HOME") .. ".cache/nvim/sig.log",
handler_opts = { border = 'single'},
}
I am using vim-cmp at the same time, and it works fine
The text was updated successfully, but these errors were encountered: