Restore index signature details in property hovers - #64586
Open
Mateusz Burzyński (Andarist) wants to merge 6 commits into
Open
Mateusz Burzyński (Andarist) wants to merge 6 commits into
Mateusz Burzyński (Andarist) wants to merge 6 commits into
Conversation
Copilot started reviewing on behalf of
Mateusz Burzyński (Andarist)
October 2, 2026 08:42
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Inherited index-signature hover containers depend on which receiver is hovered first.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Restores index-signature context in property hovers, addressing #64582.
Changes:
- Renders index containers and key types in hovers.
- Exposes checker index information to the language service.
- Adds and re-enables fourslash coverage and updates JSX baselines.
| File | Description |
|---|---|
tsc/internal/checker/exports.go |
Exposes index-symbol information. |
tsc/internal/ls/hover.go |
Formats index-signature hover details. |
tsc/internal/fourslash/tests/quickInfoIndexSignatureProperty_test.go |
Tests common index signatures. |
tsc/internal/fourslash/tests/quickInfoIndexSignaturePropertyUnchecked_test.go |
Tests unchecked indexed access. |
tsc/internal/fourslash/tests/quickInfoOnPropDeclaredUsingIndexSignatureOnInterfaceWithBase_test.go |
Re-enables inherited-signature coverage. |
tsc/internal/fourslash/tests/jsDocPropertyDescription1_test.go |
Re-enables string-index JSDoc coverage. |
tsc/internal/fourslash/tests/jsDocPropertyDescription4_test.go |
Re-enables union-key JSDoc coverage. |
tsc/internal/fourslash/tests/jsDocPropertyDescription7_test.go |
Re-enables static-index JSDoc coverage. |
tsc/testdata/baselines/reference/fourslash/quickInfo/quickInfoOnJsxIntrinsicDeclaredUsingTemplateLiteralTypeSignatures.baseline |
Updates template-literal JSX hovers. |
tsc/testdata/baselines/reference/fourslash/quickInfo/quickInfoOnJsxIntrinsicDeclaredUsingCatchCallIndexSignature.baseline |
Updates catch-all JSX hovers. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Jake Bailey (jakebailey)
approved these changes
Oct 2, 2026
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 3
Open (3)
Importing the standard-library "maps" and "slices" packages requires Go 1.21+. If this repo/tooling… · New maps.Values iterates in an unspecified order, so siblingSymbols ordering can vary between runs. If… · New GetIndexInfosOfIndexSymbol (via Checker.GetIndexInfosOfIndexSymbol) builds a slice of all parent… · New
Resolved since last review (1)
| func (c *Checker) GetIndexInfosOfIndexSymbol(symbol *ast.Symbol) []*IndexInfo { | ||
| var siblingSymbols []*ast.Symbol | ||
| if symbol.Parent != nil { | ||
| siblingSymbols = slices.Collect(maps.Values(c.getMembersOfSymbol(symbol.Parent))) |
There was a problem hiding this comment.
Yeah, I would suggest sorting these.
Comment on lines
+686
to
+700
| if symbol.CheckFlags&ast.CheckFlagsIndexSymbol != 0 { | ||
| dpw.WritePunctuation("(") | ||
| dpw.Write("index") | ||
| dpw.WritePunctuation(") ") | ||
| if symbol.Parent != nil { | ||
| writeSymbolClassified(symbol.Parent, nil, ast.SymbolFlagsNone, symbolFormatFlags) | ||
| } | ||
| dpw.WritePunctuation("[") | ||
| for i, info := range c.GetIndexInfosOfIndexSymbol(symbol) { | ||
| if i != 0 { | ||
| dpw.WritePunctuation(" | ") | ||
| } | ||
| writeTypeClassified(info.KeyType(), container, typeFormatFlags) | ||
| } | ||
| dpw.WritePunctuation("]: ") |
This branch has not been deployed
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 #64582