bcampolo / nvim-starter-kit

Neovim Starter Kit
MIT License
224 stars 34 forks source link

LSP issue rpc stderr #19

Closed WojciechChuchro closed 1 month ago

WojciechChuchro commented 1 month ago

Description I am encountering issues with the Language Server Protocol (LSP) in Neovim for both Java (jdtls) and Lua (lua-language-server). Below are the error logs for each:

[ERROR][2024-07-23 19:43:37] .../vim/lsp/rpc.lua:734 "rpc" "/local/share/nvim/mason/bin/jdtls" "stderr" "Jul 23, 2024 7:43:37 PM org.apache.aries.spifly.BaseActivator log\nINFO: Registered provider ch.qos.logback.classic.servlet.LogbackServletContainerInitializer of service jakarta.servlet.ServletContainerInitializer in bundle ch.qos.logback.classic\n"

[ERROR][2024-07-23 19:51:02] .../vim/lsp/rpc.lua:734 "rpc" "/.local/share/nvim/mason/bin/lua-language-server" "stderr" "script/encoder/utf16.lua:66: invalid UTF-8 code\nstack traceback:\n\t[C]: in upvalue '_utf8byte'\n\tscript/encoder/utf16.lua:66: in upvalue 'utf8byte'\n\tscript/encoder/utf16.lua:86: in for iterator 'for iterator'\n\tscript/encoder/utf16.lua:140: in field 'fromutf8'\n\tscript/encoder/init.lua:21: in function 'encoder.len'\n\tscript/proto/converter.lua:35: in function <script/proto/converter.lua:25>\n\t(...tail calls...)\n\tscript/core/semantic-tokens.lua:819: in upvalue 'solveMultilineAndOverlapping'\n\tscript/core/semantic-tokens.lua:928: in function 'core.semantic-tokens'\n\tscript/provider/provider.lua:1072: in function <script/provider/provider.lua:1065>\n\t[C]: in function 'xpcall'\n\tscript/proto/proto.lua:203: in function <script/proto/proto.lua:178>\n"

Mac OS NVIM v0.10.1 Build type: Release LuaJIT 2.1.1720049189

bcampolo commented 1 month ago

Are you using my Starter Kit as is or is it your own config? The Starter Kit is built on 0.9.x. I generally avoid the latest version until it's more stable, but as far as I know there shouldn't be a reason why it wouldn't work. Can you run :JdtShowLogs and paste the whole thing here?

WojciechChuchro commented 1 month ago

[ERROR][2024-07-24 19:41:30] .../vim/lsp/rpc.lua:734 "rpc" "/Users/wojciech/.local/share/nvim/mason/bin/jdtls" "stderr" "WARNING: Using incubator modules: jdk.incubator.vector\n" [ERROR][2024-07-24 19:41:30] .../vim/lsp/rpc.lua:734 "rpc" "/Users/wojciech/.local/share/nvim/mason/bin/jdtls" "stderr" "Jul 24, 2024 7:41:30 PM org.apache.aries.spifly.BaseActivator log\nINFO: Registered provider ch.qos.logback.classic.servlet.LogbackServletContainerInitializer of service jakarta.servlet.ServletContainerInitializer in bundle ch.qos.logback.classic\n"

[ERROR][2024-07-24 19:41:30] .../vim/lsp/rpc.lua:734 "rpc" "/Users/wojciech/.local/share/nvim/mason/bin/jdtls" "stderr" "Jul 24, 2024 7:41:30 PM org.apache.aries.spifly.BaseActivator log\nINFO: Registered provider ch.qos.logback.classic.spi.LogbackServiceProvider of service org.slf4j.spi.SLF4JServiceProvider in bundle ch.qos.logback.classic\n"

[ERROR][2024-07-24 19:42:48] .../vim/lsp/rpc.lua:734 "rpc" "/Users/wojciech/.local/share/nvim/mason/bin/marksman" "stderr" "[19:42:48 INF] Starting Marksman LSP server: {}\n" [ERROR][2024-07-24 19:45:13] .../vim/lsp/rpc.lua:734 "rpc" "/Users/wojciech/.local/share/nvim/mason/bin/lua-language-server" "stderr" "script/encoder/utf16.lua:66: invalid UTF-8 code\nstack traceback:\n\t[C]: in upvalue '_utf8byte'\n\tscript/encoder/utf16.lua:66: in upvalue 'utf8byte'\n\tscript/encoder/utf16.lua:86: in for iterator 'for iterator'\n\tscript/encoder/utf16.lua:140: in field 'fromutf8'\n\tscript/encoder/init.lua:21: in function 'encoder.len'\n\tscript/text-merger.lua:28: in upvalue 'getLeft'\n\tscript/text-merger.lua:68: in upvalue 'mergeRows'\n\tscript/text-merger.lua:106: in function 'text-merger'\n\tscript/provider/provider.lua:305: in function <script/provider/provider.lua:294>\n\t[C]: in function 'xpcall'\n\tscript/proto/proto.lua:200: in function <script/proto/proto.lua:175>\n"

[ERROR][2024-07-24 19:46:13] .../vim/lsp/rpc.lua:734 "rpc" "/Users/wojciech/.local/share/nvim/mason/bin/marksman" "stderr" "[19:46:13 INF] Starting Marksman LSP server: {}\n"

[ERROR][2024-07-25 17:38:40] .../vim/lsp/rpc.lua:770 "rpc" "/Users/wojciech/.local/share/nvim/mason/bin/jdtls" "stderr" "Jul 25, 2024 5:38:40 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation\nWARNING: Unmatched cancel notification for request id 2\n"

Im trying to merge two configurations - from your video about jdtls and from this repo: https://github.com/josean-dev/dev-environment-files

Should i have my java projects inside ~/jdtls-workspace?

bcampolo commented 1 month ago

Merging two configurations gets tricky, especially if there are version mismatches. The majority of the errors in your pasted logs aren't really errors, but warnings and informational messages. You shouldn't directly put anything inside of jdtls-workspace. This is like a temporary cache that jdtls uses. I think it would be best if you started from a single config (either josean's or mine) and then slowly add what you need one thing at a time. You can also use :checkhealth to see if there are configuration errors.

WojciechChuchro commented 1 month ago

Yeah i just gave up. I installed your version and will edit it. Thank you for tring to help me :D and thanks for video about SurfingKeys extension. It's pretty awesome! After i downloaded your version it started working so as you said combaining two configuration is pretty hard.