Skip to content

Support LSP document links#56011

Merged
SomeoneToIgnore merged 1 commit into
mainfrom
kb/document-links
May 26, 2026
Merged

Support LSP document links#56011
SomeoneToIgnore merged 1 commit into
mainfrom
kb/document-links

Conversation

@SomeoneToIgnore

@SomeoneToIgnore SomeoneToIgnore commented May 7, 2026

Copy link
Copy Markdown
Contributor

Closes #33587

LSP.document.links.mov

Release Notes:

  • Supported LSP document links (enabled by default, use "lsp_document_links": false to turn it off)

@SomeoneToIgnore SomeoneToIgnore self-assigned this May 7, 2026
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label May 7, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label May 7, 2026
@SomeoneToIgnore SomeoneToIgnore force-pushed the kb/document-links branch 10 times, most recently from 9d2ae70 to a50b793 Compare May 8, 2026 09:27
@SomeoneToIgnore SomeoneToIgnore marked this pull request as ready for review May 8, 2026 09:39
@SomeoneToIgnore SomeoneToIgnore requested a review from Veykril May 8, 2026 09:39
@SomeoneToIgnore SomeoneToIgnore force-pushed the kb/document-links branch 2 times, most recently from e660f37 to 96ce1de Compare May 8, 2026 12:28
# Conflicts:
#	crates/editor/src/editor.rs
@SomeoneToIgnore SomeoneToIgnore added this pull request to the merge queue May 26, 2026
Merged via the queue into main with commit 3e77442 May 26, 2026
33 checks passed
@SomeoneToIgnore SomeoneToIgnore deleted the kb/document-links branch May 26, 2026 07:12
@aviatesk

aviatesk commented May 26, 2026

Copy link
Copy Markdown
Contributor

Dynamic registration seems to need to be fixed. Opened a follow up PR: #57749

aviatesk added a commit to aviatesk/zed that referenced this pull request May 26, 2026
`register_server_capabilities` / `unregister_server_capabilities` had no
arm for `textDocument/documentLink`, so when a server saw our
`documentLink.dynamicRegistration` capability and chose to register
the provider dynamically, the registration silently fell into the
`unhandled capability registration` warning. `document_link_provider`
stayed `None`, `GetDocumentLinks::check_capabilities` returned false,
and no `textDocument/documentLink` request was ever sent.

Fixes up zed-industries#56011.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
12122J pushed a commit to 12122J/zed that referenced this pull request May 26, 2026
…dustries#57749)

`register_server_capabilities` / `unregister_server_capabilities` had no
arm for `textDocument/documentLink`, so when a server saw our
`documentLink.dynamicRegistration` capability and chose to register the
provider dynamically, the registration silently fell into the `unhandled
capability registration` warning. `document_link_provider` stayed
`None`, `GetDocumentLinks::check_capabilities` returned false, and no
`textDocument/documentLink` request was ever sent.

Follow-up to zed-industries#56011

Release Notes:

- N/A

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
@aviatesk

Copy link
Copy Markdown
Contributor

One more follow-up I wonder about: should we render document link ranges as underlined by default, similar to how VS Code does?

Right now, textDocument/documentLink seems to be surfaced mostly like textDocument/definition and it becomes visible when hovering or command-clicking a position. But documentLink is document-scoped rather than position-scoped. So unlike textDocument/definition, the server can return all jumpable link ranges for the document in one request, and each DocumentLink already includes the range it applies to. In that sense it feels closer to documentColor, diagnostics, or code lenses, and once we have the document-level data, surfacing it directly in the editor improves discoverability.

Would you be open to that as a follow-up?

@SomeoneToIgnore

SomeoneToIgnore commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

I'd ask a designer for that, myself is not very open to that as it adds more visual noise than needed.

@aviatesk

Copy link
Copy Markdown
Contributor

Understood. I think the noise argument has a validity. Since I only mentioned it as a tentative suggestion, I will hold off on upstreaming this idea for now.

jasonsmithio pushed a commit to paddleboarddev/paddleboard that referenced this pull request May 31, 2026
`register_server_capabilities` / `unregister_server_capabilities` had no
arm for `textDocument/documentLink`, so when a server saw our
`documentLink.dynamicRegistration` capability and chose to register the
provider dynamically, the registration silently fell into the `unhandled
capability registration` warning. `document_link_provider` stayed
`None`, `GetDocumentLinks::check_capabilities` returned false, and no
`textDocument/documentLink` request was ever sent.

Follow-up to zed-industries/zed#56011

Release Notes:

- N/A

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
TomPlanche pushed a commit to TomPlanche/zed that referenced this pull request Jun 2, 2026
Closes zed-industries#33587


https://github.com/user-attachments/assets/bbaea8a9-402e-485b-800e-2f4486142956

Release Notes:

- Supported LSP document links (enabled by default, use
`"lsp_document_links": false` to turn it off)
TomPlanche pushed a commit to TomPlanche/zed that referenced this pull request Jun 2, 2026
…dustries#57749)

`register_server_capabilities` / `unregister_server_capabilities` had no
arm for `textDocument/documentLink`, so when a server saw our
`documentLink.dynamicRegistration` capability and chose to register the
provider dynamically, the registration silently fell into the `unhandled
capability registration` warning. `document_link_provider` stayed
`None`, `GetDocumentLinks::check_capabilities` returned false, and no
`textDocument/documentLink` request was ever sent.

Follow-up to zed-industries#56011

Release Notes:

- N/A

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LSP: support for document links (textDocument/documentLink)

3 participants