Skip to content

Restore index signature details in property hovers - #64586

Open
Mateusz Burzyński (Andarist) wants to merge 6 commits into
microsoft:mainfrom
Andarist:restore-index-signature-hover
Open

Mateusz Burzyński (Andarist) wants to merge 6 commits into
microsoft:mainfrom
Andarist:restore-index-signature-hover

Conversation

@Andarist

Copy link
Copy Markdown
Contributor

fixes #64582

Copilot AI balanced review requested due to automatic review settings October 2, 2026 08:40
@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Oct 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Inherited index-signature hover containers depend on which receiver is hovered first.

Review effort: Balanced
Findings: 1 High severity

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.

Comment thread tsc/internal/ls/hover.go Outdated
@jakebailey
Jake Bailey (jakebailey) requested a balanced review from Copilot October 2, 2026 17:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity

Open (3)
Resolved since last review (1)

Comment thread tsc/internal/checker/exports.go
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)))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I would suggest sorting these.

Comment thread tsc/internal/ls/hover.go
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("]: ")
@typescript-automation typescript-automation Bot added For Backlog Bug PRs that fix a backlog bug and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Oct 2, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Backlog Bug PRs that fix a backlog bug

Projects

Status: Needs merge

Development

Successfully merging this pull request may close these issues.

Info missing when hover on a proptery compare to TS6

3 participants