-
Notifications
You must be signed in to change notification settings - Fork 730
Add docs to signature help #2009
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds documentation support to signature help responses in the language server. When a function or method has JSDoc comments, those comments are now included in the signature help information displayed to users.
Key Changes
- The language server now extracts and formats JSDoc comments from function/method declarations
- Documentation is provided in the client's preferred format (markdown or plaintext)
- Client capabilities are checked to determine the appropriate documentation format
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
internal/lsp/server.go |
Added getSignatureHelpDocumentationFormat function to extract client's preferred documentation format from initialization params and pass it to signature help provider |
internal/ls/signaturehelp.go |
Modified signature help generation to extract JSDoc comments from declarations and include them in the response with proper formatting |
internal/fourslash/fourslash.go |
Updated default test capabilities to support markdown documentation in signature help |
testdata/baselines/reference/fourslash/signatureHelp/*.baseline |
Updated test baselines showing documentation now appears in signature help responses |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| ParameterInformation: &lsproto.ClientSignatureParameterInformationOptions{ | ||
| LabelOffsetSupport: ptrTrue, | ||
| }, | ||
| ActiveParameterSupport: ptrTrue, | ||
| }, | ||
| ContextSupport: ptrTrue, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are not actually checking these correctly currently (different PR).
These were missing; noticed while working on #1998.
Better viewed without whitespace: https://github.com/microsoft/typescript-go/pull/2009/files?w=1