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

Ability to follow links to symbols in Quick Documentation #497

Open
harry-xm opened this issue Aug 29, 2024 · 4 comments
Open

Ability to follow links to symbols in Quick Documentation #497

harry-xm opened this issue Aug 29, 2024 · 4 comments
Labels
enhancement New feature or request hover

Comments

@harry-xm
Copy link

Screen.Recording.2024-0.mp4

This combined with the Jump to Source button in the bottom right corner is the IntelliJ-native user experience that I would like to reproduce in LSP4IJ.

Originally posted by @harry-xm in #496 (reply in thread)

@angelozerr angelozerr added enhancement New feature or request hover labels Aug 29, 2024
@angelozerr
Copy link
Contributor

@harry-xm I have installed the vscode rust extension https://code.visualstudio.com/docs/languages/rust and when you click on a symbol it opens the web browser.

I don't understand how you want to implement this feature if the rust-analyzer language server generate URL?

@harry-xm
Copy link
Author

I would convert URLs back to symbol links, which requires API from LSP4IJ to allow me to modify the content.

Symbol links are not part of the LSP spec anyways, so I think some conversion is necessary. This is a good UX from IntelliJ that I want to keep.

@angelozerr
Copy link
Contributor

I would convert URLs back to symbol links, which requires API from LSP4IJ to allow me to modify the content.

Symbol links are not part of the LSP spec anyways, so I think some conversion is necessary. This is a good UX from IntelliJ that I want to keep.

Ok I see the idea, but suggest that you try vscode rust extension before to see if it supports this feature and it seems it doesn't support it. I think the best solution is that rust-analyzer generate url with a file schema and use # to set the line , column.

Or if it is hard to generate the linecolumn (for performance reason),uses a custom schema like

rust://MySymbol

If this solution ischoosen, LSP4IJ must provide an extension point process urrl with rust:// to open the file where symbol is defined.

@harry-xm
Copy link
Author

I would convert URLs back to symbol links, which requires API from LSP4IJ to allow me to modify the content.

Symbol links are not part of the LSP spec anyways, so I think some conversion is necessary. This is a good UX from IntelliJ that I want to keep.

Ok I see the idea, but suggest that you try vscode rust extension before to see if it supports this feature and it seems it doesn't support it. I think the best solution is that rust-analyzer generate url with a file schema and use # to set the line , column.

Yes, I have tried that and VSCode does not support this feature AFAIK, but LSP4IJ is competing on the IntelliJ platform. If we are just trying to replicate the experience on VSCode, I can't think of a good reason for myself not to just use VSCode instead and save the hassle of implementing and maintaining a language plugin.

Or if it is hard to generate the linecolumn (for performance reason),uses a custom schema like

rust://MySymbol

If this solution ischoosen, LSP4IJ must provide an extension point process urrl with rust:// to open the file where symbol is defined.

It's not just about Rust, Go on LSP4IJ and VSCode have the same problem. This is best resolved as a client-negotiable feature of the LSP spec. Otherwise, I'm not motivated to convince rust-analyzer and gopls to support a custom schema, and prefer to transform the links on my own in a client-side plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hover
Projects
None yet
Development

No branches or pull requests

2 participants