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

Add support for textDocument/documentLink on imports #18706

Open
osiewicz opened this issue Dec 17, 2024 · 3 comments
Open

Add support for textDocument/documentLink on imports #18706

osiewicz opened this issue Dec 17, 2024 · 3 comments
Labels
A-ide general IDE features A-lsp LSP conformance issues and missing features C-feature Category: feature request

Comments

@osiewicz
Copy link
Contributor

It would be great to have RA support textDocument/documentLink.
In particular having documentation links associated with spans of import statements would be superb; gopls already does it, where cmd-clicking on import name takes you to the docs for a given package.
RA already has "Open docs" command for VSC, but that's a spec extension.

I would be happy to work on that if the core team would be willing to accept such contribution.

@osiewicz osiewicz added the C-feature Category: feature request label Dec 17, 2024
@Veykril Veykril added A-lsp LSP conformance issues and missing features A-ide general IDE features labels Dec 17, 2024
@Veykril
Copy link
Member

Veykril commented Dec 17, 2024

In particular having documentation links associated with spans of import statements would be superb; gopls already does it, where cmd-clicking on import name takes you to the docs for a given package.

I am not sure I quite follow, do you mean in the following:

use std::vec::Vec;

control clicking the Vec should open the documentation site for Vec? I am not sure I'd like that, control clicking in VSCode today brings you to the declaration there so this would be at odds with that.

@osiewicz
Copy link
Contributor Author

Yeah, that's the interaction I'm suggesting. I can see your point (I tend to use that myself sometimes).
Admittedly, I mostly just want to bring "open docs" support to Zed without having to resort to supporting a protocol extension.

@Veykril
Copy link
Member

Veykril commented Dec 22, 2024

Sorry this took a bit longer, was thinking this a bit.

So to me this doesn't feel quite right, textDocument/documentLink to me implies (the docs are rather vague on it tbf) that it yields ranges that act as links to resources, think of URIs and file paths in comments / strings (most of which an editor natively already does). It does not sound right to me that this would mark all identifiers (or a specific subset) of a document as links to their docs of what they resolve to.

The only thing I'd see we'd support here would be resolving intradoclinks (rust specific construct) within doc comments (and other kinds of links within them), though we also already resolve those to their corresponding definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ide general IDE features A-lsp LSP conformance issues and missing features C-feature Category: feature request
Projects
None yet
Development

No branches or pull requests

2 participants