You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, I am quite new to lspconfig. I was trying to start a java_language_server similarly to pyright, so I went to CONFIG.md and there it says (very similarly to pyright):
Snippet to enable the language server:
require'lspconfig'.java_language_server.setup{}
Well, when I put this string as-is into my init.lua nothing works. Moreover, this even breaks :LspInfo command with a very cryptic error message "E5108: Error executing lua Vim:E928: String required". Now of course after a bit of self-reflection I found that I have to specify cmd pointing to jls, which is apparently the missing string. I propose to implement one or more of the following 3 fixes:
Change the error message from LspInfo (and wherever else) from the cryptic E5108 to something more concrete, like "set cmd variable in java_language_server.setup{}" or "cmd variable for java_language_server not defined".
A bit more controversially one can change the default value of cmd from {} to { "path/to/your/lang_server_linux.sh"} or to {"java-language-server"}. At least this way you can get a more adequate error from :LspInfo.
The text was updated successfully, but these errors were encountered:
These are all community contributed, if you'd like to change the java_language_server documentation, you can make a pull request. FWIW, the jdtls documentation makes this more clear, so you can use that as a template.
First of all, I am quite new to lspconfig. I was trying to start a java_language_server similarly to pyright, so I went to CONFIG.md and there it says (very similarly to pyright):
Snippet to enable the language server:
Well, when I put this string as-is into my init.lua nothing works. Moreover, this even breaks
:LspInfo
command with a very cryptic error message "E5108: Error executing lua Vim:E928: String required". Now of course after a bit of self-reflection I found that I have to specifycmd
pointing to jls, which is apparently the missing string. I propose to implement one or more of the following 3 fixes:or to something that would work automatically with a package-installed language server:
cmd
from{}
to{ "path/to/your/lang_server_linux.sh"}
or to{"java-language-server"}
. At least this way you can get a more adequate error from:LspInfo
.The text was updated successfully, but these errors were encountered: