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

'Docs for symbol' on the closing parenthesis shows last argument instead of function docs #2810

Closed
Houkime opened this issue Jun 19, 2022 · 8 comments

Comments

@Houkime
Copy link
Contributor

Houkime commented Jun 19, 2022

Expected:

space+k opening the function doc popup when cursor is on function call parentheses or inside them.

What actually happens:

screen
screen

Why important:

Prevents easy lookup of function args while filling in the call.

@the-mikedavis
Copy link
Member

the-mikedavis commented Jun 19, 2022

Which language server is this? Hover on parens gives the function documentation with rust-analyzer. We only show in hover what the language server gives so this should most likely be reported upstream to the language server repo.

@Houkime
Copy link
Contributor Author

Houkime commented Jun 19, 2022

this is rust-analyzer 0.0.0 (366bd7242 2022-06-12)
https://archlinux.org/packages/community/x86_64/rust-analyzer/

@Houkime
Copy link
Contributor Author

Houkime commented Jun 19, 2022

ok, after more investigation, this is a bit more nuanced.

a proper function call with all args in place, first parenthesis
screen
the same call, last parenthesis (look, it shows the argument, not the function)
screen
the empty call, first parenthesis works as needed
screen
but the LAST parenthesis does not.
screen

@the-mikedavis
Copy link
Member

Does that draw_circle() line need a trailing semicolon to finish the statement? This behavior might be produced by invalid syntax.

@Houkime Houkime changed the title 'docs for symbol under cursor' shows parentheses instead of function docs 'Docs for symbol' on the closing parenthesis shows last argument instead of function docs Jun 19, 2022
@Houkime
Copy link
Contributor Author

Houkime commented Jun 19, 2022

Does that draw_circle() line need a trailing semicolon to finish the statement? This behavior might be produced by invalid syntax.

screen

Semicolon does not change anything.

These () are Rust's void. See, when the last parenthesis is inspected on the healthy call of clear_background, it shows info about the DARKGRAY color, ie, about the argument inserted into that call. If we paste something into this last call to draw_circle, see what happens:

screen

@Houkime
Copy link
Contributor Author

Houkime commented Jun 19, 2022

kak-lsp (written in Rust) has lsp-auto-signature-help-enable which covers filling in long function calls.
https://github.com/kak-lsp/kak-lsp
It displays the signature in a line at the bottom of the screen.

@sudormrfbin
Copy link
Member

Signature help is being worked on in #1755.

@the-mikedavis
Copy link
Member

The parens appear to be expected behavior from rust-analyzer: it's showing the return type of the call when hovering the trailing paren. There's an issue for signature help (plus the pr) #1331 so let's close this in favor of that issue

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

3 participants