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 SymbolInformation.signature_documentation #159

Merged
merged 2 commits into from
May 30, 2023

Conversation

olafurpg
Copy link
Member

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
Copy link
Member 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.

scip.proto Outdated Show resolved Hide resolved
// 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
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
Member 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
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