Skip to content

Add SymbolInformation.signature_documentation - #159

Merged
olafurpg merged 2 commits into
mainfrom
olafurpg/signature_documentation
May 30, 2023
Merged

Add SymbolInformation.signature_documentation#159
olafurpg merged 2 commits into
mainfrom
olafurpg/signature_documentation

Conversation

@olafurpg

Copy link
Copy Markdown
Contributor

Towards #154

Previously, SCIP clients had to parse markdown from the SymbolInformation.documentation field to display only the signature information of a symbol (for example, method parameters and return type).

With the new SymbolInformation.signature_documentation field, indexers can now emit more structured information about the signature of a class/method including optional hyperlinks to the referenced symbols.

Test plan

Green CI.

Towards #154

Previously, SCIP clients had to parse markdown from the
`SymbolInformation.documentation` field to display only the signature
information of a symbol (for example, method parameters and return
type).

With the new `SymbolInformation.signature_documentation` field, indexers
can now emit more structured information about the signature of a
class/method including optional hyperlinks to the referenced symbols.
@olafurpg
olafurpg requested a review from varungandhi-src May 25, 2023 09:47
@olafurpg

Copy link
Copy Markdown
Contributor Author

cc/ @donsbot I'd love your thought on this approach.

I'm open for suggestions on an alternative encoding that Document. I think it's desirable to be able to support hyperlinking symbols in the signature since that's a pretty standard feature in API documentation tools like Javadoc.

Comment thread scip.proto Outdated
Comment thread scip.proto
// introduced to support `SymbolInformation.signature_documentation`, but it
// can be used for other purposes as well, for example testing or when working
// with virtual/in-memory documents.
string text = 5;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about "content" instead of "text"? don't have a strong preference either way.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went with text to mirror TextDocumentItem.text in LSP (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentItem) and Document.getText() in VS Code. I'm personally fine either way but think it's a safe choice to stick with LSP terminology when appropriate.

@olafurpg
olafurpg merged commit 1346f26 into main May 30, 2023
@olafurpg
olafurpg deleted the olafurpg/signature_documentation branch May 30, 2023 11:06
nicolas-guichard added a commit to mozsearch/scip-typescript that referenced this pull request Jul 8, 2026
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

Successfully merging this pull request may close these issues.

3 participants