Fix hover documentation for intersected properties - #4646
Open
cuishuang wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes hover/QuickInfo documentation loss for synthetic intersection (and union) properties that have declarations but no value declaration by falling back to aggregating JSDoc from all symbol declarations, with a regression fourslash test.
Changes:
- Refactors documentation collection into
getDocumentationFromDeclarations(gather + dedupe across declarations). - Updates hover documentation retrieval to fall back to declaration-based docs when no
info.declarationis available. - Adds a fourslash regression test asserting merged hover documentation for an
A & Bproperty.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/ls/jsdoc.go | Extracts a helper to gather/dedupe documentation text across a provided declaration list. |
| internal/ls/hover.go | Adds a hover fallback path to use aggregated docs when there is no value declaration (synthetic union/intersection properties). |
| internal/fourslash/tests/hoverIntersectionPropertyDocumentation_test.go | Adds a regression test verifying merged hover docs for an intersection property. |
Contributor
|
this issue is already being fixed by my older PR: #3663 |
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.
Fixes microsoft/TypeScript#63640.
Synthetic intersection properties can have multiple declarations but no value declaration. Hover documentation previously only inspected the value declaration, causing the merged JSDoc to be lost.
This change falls back to gathering and deduplicating documentation from all symbol declarations and adds a regression test.
This change was developed with assistance from OpenAI Codex. I reviewed and understand the patch and will respond to review feedback.