Skip to content

Only surface "sort imports" and "remove unused imports" when TS client is running/useTsgo is not active#317656

Merged
mjbvz merged 1 commit into
mainfrom
dev/mjbvz/financial-xerinae
May 21, 2026
Merged

Only surface "sort imports" and "remove unused imports" when TS client is running/useTsgo is not active#317656
mjbvz merged 1 commit into
mainfrom
dev/mjbvz/financial-xerinae

Conversation

@mjbvz
Copy link
Copy Markdown
Collaborator

@mjbvz mjbvz commented May 20, 2026

Fixes #317413

Copilot AI review requested due to automatic review settings May 20, 2026 23:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the built-in TypeScript/JavaScript extension’s command contributions so “Sort Imports” and “Remove Unused Imports” are only shown when the built-in TS workflow is active (i.e. not using useTsgo), addressing the conflict described in #317413.

Changes:

  • Adds useTsgo + typescript.isManagedFile gating to the command palette visibility of the four sort/remove import commands.
  • Adds enablement expressions to the four command contributions to disable them when useTsgo is enabled.
Show a summary per file
File Description
extensions/typescript-language-features/package.json Gates sort/remove-imports command visibility (and now enablement) on useTsgo being off and on the managed-file context.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment on lines 2892 to +2914
{
"command": "typescript.sortImports",
"title": "%typescript.sortImports%",
"category": "TypeScript"
"category": "TypeScript",
"enablement": "!config.js/ts.experimental.useTsgo && !config.typescript.experimental.useTsgo && typescript.isManagedFile"
},
{
"command": "javascript.sortImports",
"title": "%typescript.sortImports%",
"category": "JavaScript"
"category": "JavaScript",
"enablement": "!config.js/ts.experimental.useTsgo && !config.typescript.experimental.useTsgo && typescript.isManagedFile"
},
{
"command": "typescript.removeUnusedImports",
"title": "%typescript.removeUnusedImports%",
"category": "TypeScript"
"category": "TypeScript",
"enablement": "!config.js/ts.experimental.useTsgo && !config.typescript.experimental.useTsgo && typescript.isManagedFile"
},
{
"command": "javascript.removeUnusedImports",
"title": "%typescript.removeUnusedImports%",
"category": "JavaScript"
"category": "JavaScript",
"enablement": "!config.js/ts.experimental.useTsgo && !config.typescript.experimental.useTsgo && typescript.isManagedFile"
@mjbvz mjbvz enabled auto-merge May 21, 2026 00:06
@mjbvz mjbvz merged commit 149ab78 into main May 21, 2026
29 checks passed
@mjbvz mjbvz deleted the dev/mjbvz/financial-xerinae branch May 21, 2026 00:32
@vs-code-engineering vs-code-engineering Bot added this to the 1.122.0 milestone May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only surface "sort imports" and "remove unused imports" when TS client is running/useTsgo is not active

3 participants