nim-lang/langserver

testDocument/hover not supported for nim

Clonkk opened this issue · 5 comments

When using nimlangserver as an lsp server for neovim I cannot get documentation information as hover.

In the README hover is said to be supported; is there a specific configuration I should pass or just declaring nimlangserver as lsp provider supposed to be enough ?

Additional info :

  • Nim v1.6.6 and lastest devel both have the same issues.
  • Running LspStatus : nimlangserver : exitedso I assume that it's a crash ?

Do you have anything working? If it is crashing, can you post the stderr output?

This is the log generated by neovim :

mer. 13 juil. 2022 14:47:21:["lsp#register_server", "server registered", "nimlangserver"]
mer. 13 juil. 2022 14:47:21:["lsp#register_server", "server registered", "pyls"]
mer. 13 juil. 2022 14:47:21:["s:on_text_document_did_open()", 1, "nim", "/home/rcaillaud/Workspace/DeepColor/BaseProject/Packages/deepcolor/commons/storage", "file:///home/rcaillaud/Workspace/DeepColor/BaseProject/Packages/deepcolor/commons/storage/h5lite/dbchoice.nim"]
mer. 13 juil. 2022 14:47:21:["Starting server", "nimlangserver", ["nimlangserver"]]
mer. 13 juil. 2022 14:47:21:[{"response": {"data": {"__data__": "vim-lsp", "lsp_id": 6, "server_name": "nimlangserver"}, "message": "started lsp server successfully"}}]
mer. 13 juil. 2022 14:47:21:[{"response": {"error": {"data": {"lsp_id": 6, "__error__": "vim-lsp", "server_name": "nimlangserver"}, "code": 0, "message": "ignore initialization lsp server due to empty root_uri"}}}]
mer. 13 juil. 2022 14:47:21:[{"response": {"data": {"__data__": "vim-lsp", "server_name": "nimlangserver"}, "message": "configuration sent"}}]
mer. 13 juil. 2022 14:47:21:["s:update_file_content()", 1]
mer. 13 juil. 2022 14:47:21:[{"response": {"data": {"path": "file:///home/rcaillaud/Workspace/DeepColor/BaseProject/Packages/deepcolor/commons/storage/h5lite/dbchoice.nim", "__data__": "vim-lsp", "filetype": "nim", "server_name": "nimlangserver"}, "message": "textDocument/open sent"}}]
mer. 13 juil. 2022 14:47:21:[{"response": {"data": {"path": "file:///home/rcaillaud/Workspace/DeepColor/BaseProject/Packages/deepcolor/commons/storage/h5lite/dbchoice.nim", "__data__": "vim-lsp", "server_name": "nimlangserver"}, "message": "not dirty"}}]
mer. 13 juil. 2022 14:47:21:["s:on_exit", 6, "nimlangserver", "exited", 139]

I think no lsp features are working (all the Lsp* function return a "not supported" error). it's logical since the server doesn't appear to be running.

Can you ask in neovim team how to obtain the content of stderr?

"ignore initialization lsp server due to empty root_uri"

Not sure what to do to make this go away, but typically you have to add project root and lsp client should send rootUri to the server. This is mandatory for nimlangserver

I'm looking into getting stderr for the process.

Not sure what to do to make this go away, but typically you have to add project root and lsp client should send rootUri to the server.

No idea. I litterally copied & pasted the configuration for nimlsp, just replacing the command nimlsp -> nimlangserver. Since it worked for nimlsp I assumed it could worked for nimlangserver.

The setup in ~/.config/init.vim looks like this :

  let s:nimlangserver_executable = "nimlangserver"
  if executable(s:nimlangserver_executable)
    au User lsp_setup call lsp#register_server({
    \ 'name': 'nimlangserver',
    \ 'cmd': {server_info->[s:nimlangserver_executable]},
    \ 'allowlist': ['nim'],
    \ })
  endif