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

[hover] Display the last MarkedString when there are multiple. #224

Closed
wants to merge 1 commit into from

Conversation

MaskRay
Copy link
Member

@MaskRay MaskRay commented Dec 27, 2017

    ;; We may receive multiple MarkedString's in the Hover response,
    ;; render the last one because others are likely comments which will
    ;; make the eldoc message span multiple lines.

For comments, @sebastiencs 's lsp-ui-doc.el should be preferred.

See emacs-lsp/lsp-ui#19 for some demos.

@vibhavp
Copy link
Member

vibhavp commented Dec 28, 2017

Why discard other lines? I think this could be better achieved by let-binding.

@MaskRay
Copy link
Member Author

MaskRay commented Dec 28, 2017

I discard other lines because only the last line is about function/variable/type signature, others are usually documentation. Displaying multiple lines in eldoc is less appealing. Too be more precise, we could filter out all languages other than ones with the language-id the server tells us.

rls

{"jsonrpc":"2.0","id":190,"result":{"contents":[" meow\n",{"language":"rust","value":"fn () -> i32"}],"range":null}}

cquery
"contents":[{"language":"text",...}, {"language":"cpp",...}]

The issue is that textDocument/hover does not encode the client "intention", whether it is displayed in a popup window (VSCode), or displayed in status bar / minibuffer (lsp-mode, LanguageClient-neovim#224). Without that, the language server has to return all necessary information but clients may have a problem rendering it.

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

Successfully merging this pull request may close these issues.

2 participants