Skip to content
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

testDocument/hover not supported for nim #19

Open
Clonkk opened this issue Jul 13, 2022 · 5 comments
Open

testDocument/hover not supported for nim #19

Clonkk opened this issue Jul 13, 2022 · 5 comments

Comments

@Clonkk
Copy link

Clonkk commented Jul 13, 2022

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 ?

@Clonkk
Copy link
Author

Clonkk commented Jul 13, 2022

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 ?

@yyoncho
Copy link
Collaborator

yyoncho commented Jul 13, 2022

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

@Clonkk
Copy link
Author

Clonkk commented Jul 13, 2022

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.

@yyoncho
Copy link
Collaborator

yyoncho commented Jul 13, 2022

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

@Clonkk
Copy link
Author

Clonkk commented Jul 13, 2022

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


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants