-
Notifications
You must be signed in to change notification settings - Fork 640
Display JSDoc documentation in Quick Info #1018
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 enhances the hover functionality by displaying enhanced Quick Info that includes JSDoc documentation and fixes several language service crashes (fixes #992). Key changes include updates to the parser for JSDoc template tags, refactoring of hover info generation to integrate JSDoc comments, and various adjustments in the checker, AST, and binder modules to accommodate new JSDoc behaviors.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
internal/parser/reparser.go | Simplifies iteration over JSDoc template tag type parameters. |
internal/ls/hover.go | Introduces Quick Info formatting that incorporates JSDoc details in hover information. |
internal/checker/utilities.go | Removes redundant helper in favor of the AST-level implementation. |
internal/checker/types.go | Adds a new formatting flag for call-style signature output. |
internal/checker/printer.go | Adjusts the condition for formatting constructor signatures for better call-style support. |
internal/checker/checker.go | Replaces legacy helper calls with AST-level ones and updates type alias link assignment. |
internal/binder/binder.go | Reorders calls to set JSDoc parents to streamline AST binding. |
internal/ast/utilities.go | Introduces a new AST helper to check property access contexts. |
internal/ast/ast.go | Updates JSDoc template tag handling to expose type parameters as a public field. |
internal/api/encoder/encoder.go | Uses direct field access for JSDoc template tag type parameters for encoding. |
Comments suppressed due to low confidence (3)
internal/checker/checker.go:21557
- The change from 'declaredTypeLinks' to 'typeAliasLinks' appears intentional for handling type aliases; please confirm that this adjustment correctly aligns with the semantic requirements for unresolved type handling.
c.typeAliasLinks.Get(result).declaredType = c.unresolvedType
internal/binder/binder.go:1577
- [nitpick] The repositioning of 'b.setJSDocParents(node)' in the binder function changes the order of JSDoc parent binding relative to child binding; please verify that the new ordering covers all necessary nodes.
b.setJSDocParents(node)
internal/checker/printer.go:279
- [nitpick] The updated condition for determining a constructor excludes call-style signature formatting when the WriteCallStyleSignature flag is set; please ensure this change correctly reflects the desired behavior for constructor signature output.
isConstructor := signature.flags&SignatureFlagsConstruct != 0 && flags&TypeFormatFlagsWriteCallStyleSignature == 0
I was bad and #992 was an issue that should have been two; I assume the crash is what's fixed, not the actual bad type error? |
Right, this PR just fixes the crash. |
ATA test flake :( |
With this PR we now include JSDoc documentation when hovering over code elements:
This PR also fixes several language service crashes, including #992.
Fixes #992.