Skip to content

Restore symbol names in JSX import action titles - #64588

Open
Mateusz Burzyński (Andarist) wants to merge 1 commit into
microsoft:mainfrom
Andarist:restore-jsx-import-action-titles
Open

Mateusz Burzyński (Andarist) wants to merge 1 commit into
microsoft:mainfrom
Andarist:restore-jsx-import-action-titles

Conversation

@Andarist

Copy link
Copy Markdown
Contributor

A pretty close port of the Strada's logic that fixes 2 skipped tests

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

Copy link
Copy Markdown
Contributor

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

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: 5 Medium severity · 2 Low severity

Open (7)
What changed in this PR

Ports Strada behavior to optionally include the symbol name in auto-import fix descriptions, and re-enables previously skipped JSX import name code-fix tests.

Changes:

  • Added an includeSymbolNameInDescription flag to autoimport.Fix.Edits and threaded it through key call sites.
  • Adjusted import code action generation to detect JSX namespace fixes and include the symbol name in the action title when appropriate.
  • Unskipped two failing fourslash JSX import-name code-fix tests.
File Description
tsc/​internal/​ls/​completions.go Updates autoimport.Fix.Edits invocations to pass the new symbol-in-description flag (currently false) to preserve existing completion detail behavior.
tsc/​internal/​ls/​codeactions_importfixes.go Adds errorIdentifierText to fixInfo and uses it to decide when to include symbol names in import code action titles (JSX namespace cases).
tsc/​internal/​ls/​autoimport/​fix.go Extends Fix.Edits signature and conditionally returns a symbol-containing description string for add/update import fixes.
tsc/​internal/​fourslash/​tests/​importNameCodeFix_jsx4_test.go Re-enables the previously skipped JSX fourslash test.
tsc/​internal/​fourslash/​tests/​importNameCodeFix_jsx6_test.go Re-enables the previously skipped JSX fourslash test.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

formatOptions lsutil.FormatCodeSettings,
converters *lsconv.Converters,
preferences lsutil.UserPreferences,
includeSymbolNameInDescription bool,
Comment on lines +79 to +81
if includeSymbolNameInDescription {
return edits, diagnostics.Import_0_from_1.Localize(locale, f.Name, f.ModuleSpecifier), safe
}
Comment on lines +79 to 82
if includeSymbolNameInDescription {
return edits, diagnostics.Import_0_from_1.Localize(locale, f.Name, f.ModuleSpecifier), safe
}
return edits, diagnostics.Update_import_from_0.Localize(locale, f.ModuleSpecifier), safe
Comment on lines +114 to +116
if includeSymbolNameInDescription {
return edits, diagnostics.Import_0_from_1.Localize(locale, f.Name, f.ModuleSpecifier), safe
}
Comment on lines +114 to 117
if includeSymbolNameInDescription {
return edits, diagnostics.Import_0_from_1.Localize(locale, f.Name, f.ModuleSpecifier), safe
}
return edits, diagnostics.Add_import_from_0.Localize(locale, f.ModuleSpecifier), safe
Comment on lines +79 to 82
if includeSymbolNameInDescription {
return edits, diagnostics.Import_0_from_1.Localize(locale, f.Name, f.ModuleSpecifier), safe
}
return edits, diagnostics.Update_import_from_0.Localize(locale, f.ModuleSpecifier), safe
Comment on lines +114 to 117
if includeSymbolNameInDescription {
return edits, diagnostics.Import_0_from_1.Localize(locale, f.Name, f.ModuleSpecifier), safe
}
return edits, diagnostics.Add_import_from_0.Localize(locale, f.ModuleSpecifier), safe
@jakebailey

Copy link
Copy Markdown
Member

Copilot absolutely hates this 😄

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 Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

3 participants