Restore symbol names in JSX import action titles - #64588
Mateusz Burzyński (Andarist) wants to merge 1 commit into
Conversation
|
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
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: 5
Open (7)
This change introduces a new behavioral branch inFix.Editsthat alters the returned description… · New This change introduces a new behavioral branch inFix.Editsthat alters the returned description… · New The symbol-inclusive description usesImport_0_from_1for both “add new” and “add to existing”… · New This change introduces a new behavioral branch inFix.Editsthat alters the returned description… · New The symbol-inclusive description usesImport_0_from_1for both “add new” and “add to existing”… · New TheincludeSymbolNameInDescriptionbranching is duplicated across fix kinds. To reduce repetition… · New TheincludeSymbolNameInDescriptionbranching is duplicated across fix kinds. To reduce repetition… · New
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
includeSymbolNameInDescriptionflag toautoimport.Fix.Editsand 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, |
| if includeSymbolNameInDescription { | ||
| return edits, diagnostics.Import_0_from_1.Localize(locale, f.Name, f.ModuleSpecifier), safe | ||
| } |
| 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 |
| if includeSymbolNameInDescription { | ||
| return edits, diagnostics.Import_0_from_1.Localize(locale, f.Name, f.ModuleSpecifier), safe | ||
| } |
| 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 |
| 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 |
| 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 |
|
Copilot absolutely hates this 😄 |


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