Add DocCSymbolLinkDefinition request - #76
Open
Padmashree06 wants to merge 1 commit into
Open
Conversation
Padmashree06
requested review from
ahoppen,
hamishknight,
owenv and
rintaro
as code owners
August 7, 2026 20:12
Padmashree06
force-pushed
the
Add-DocCSymbolLinkDefinitionRequest
branch
from
August 10, 2026 06:03
4789cd1 to
0c7eed9
Compare
ahoppen
reviewed
Aug 10, 2026
ahoppen
left a comment
Member
There was a problem hiding this comment.
Two high-level questions:
- Where does the editor get the symbol link from?
- Depending on how the editor extracts the symbol name, can’t SourceKit-LSP do it and thus can’t this be implemented using a
textDocument/definitionrequest?
Author
|
ahoppen
reviewed
Aug 10, 2026
ahoppen
left a comment
Member
There was a problem hiding this comment.
Sounds reasonable to me then, just two small comments.
|
|
||
| public struct DocCSymbolLinkDefinitionRequest: TextDocumentRequest, Hashable { | ||
| public static let method: String = "sourcekit/textDocument/doccSymbolLinkDefinition" | ||
| public typealias Response = Location? |
Member
There was a problem hiding this comment.
Should this be LocationsOrLocationLinksResponse? to match textDocument/definition? It would also allow us to return multiple locations in case the symbol link is ambiguous.
| /// This request is an extension to LSP supported by SourceKit-LSP. | ||
| /// The client is expected to navigate to the returned location, or display an appropriate error | ||
| /// message to the user if the response is `nil`. | ||
|
|
Padmashree06
force-pushed
the
Add-DocCSymbolLinkDefinitionRequest
branch
from
August 10, 2026 12:41
0c7eed9 to
03b2b27
Compare
Author
|
I have made the changes! Thanks for the review! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
DocCSymbolLinkDefinitionRequest, a new LSP extension request that resolves a DocC symbol link string to the location of the symbol it refers to.Motivation
Currently, symbol links in the DocC Live Preview are not clickable. To enable this, we need a new request that adds the functionality of navigating to the symbol's definition if it exists, or showing an error when it doesn't - making the preview interactive.
Details
DocCSymbolLinkDefinitionRequesttakes the symbol link string and the document's URI as arguments and returns theLocationof where the symbol is defined.