Skip to content

Warn on TSServer Plugin Contributions from other extensions - #4063

Merged
Daniel Rosenwasser (DanielRosenwasser) merged 19 commits into
mainfrom
warnOnPlugins
Jun 22, 2026
Merged

Warn on TSServer Plugin Contributions from other extensions#4063
Daniel Rosenwasser (DanielRosenwasser) merged 19 commits into
mainfrom
warnOnPlugins

Conversation

@DanielRosenwasser

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) commented May 27, 2026

Copy link
Copy Markdown
Member

Fixes #3848

(Builds on #4052)

Fixes #3848.

No workspace, one extension

image

Workspace, 2 extensions

image

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) changed the title Warn on plugins Warn on TSServer Plugin Contributios from other extensions May 27, 2026
@DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser) marked this pull request as ready for review May 27, 2026 19:45
Copilot AI review requested due to automatic review settings May 27, 2026 19:45

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 encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 5

Comment thread _extension/src/extension.ts Outdated
const settingName = getWinningTsgoConfigKey()!;
assert(settingName !== undefined, "Expected some useTsgo configuration to be explicitly set.");

const target = getExplicitConfigTarget(vscode.workspace.getConfiguration(), settingName);
Comment thread _extension/src/extension.ts Outdated
Comment thread _extension/src/extension.ts Outdated
Comment on lines +130 to +132
warnAboutTsServerPlugins(context, output);
context.subscriptions.push(vscode.extensions.onDidChange(() => {
warnAboutTsServerPlugins(context, output);
Comment thread _extension/src/extension.ts Outdated
Comment on lines +220 to +230
const ok = "OK";
const disableInWorkspace = "Disable in Workspace";
const dontShowAgain = hasWorkspaceFolder ? "Don't Show Again in Workspace" : "Don't Show Again";

const options = [ok];
if (hasWorkspaceFolder) {
options.push(disableInWorkspace);
}
options.push(dontShowAgain);

const selected = await vscode.window.showWarningMessage(message, ...options);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Maybe we should just have some state so we don't show it more than once per session.

Comment thread _extension/src/extension.ts Outdated
@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) changed the title Warn on TSServer Plugin Contributios from other extensions Warn on TSServer Plugin Contributions from other extensions May 27, 2026
Comment thread _extension/src/extension.ts Outdated

const message = uniqueExtensionNames.length === 1
// Pick the first extension & plugin, even though extensions can have multiple plugins
? `The ${pluginExtensions[0].pluginName} plugin from the extension "${pluginExtensions[0].extensionId}" will not be applied because TypeScript Native Preview is enabled globally.`

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.

The plugin name could use some quotes to lessen the "plugin plugin" effect

Image
Suggested change
? `The ${pluginExtensions[0].pluginName} plugin from the extension "${pluginExtensions[0].extensionId}" will not be applied because TypeScript Native Preview is enabled globally.`
? `The "${pluginExtensions[0].pluginName}" plugin from the extension "${pluginExtensions[0].extensionId}" will not be applied because TypeScript Native Preview is enabled globally.`

Comment thread _extension/src/extension.ts Outdated
: `${uniqueExtensionNames.length} extensions contribute TypeScript server plugins that will not be applied because TypeScript Native Preview is enabled globally: ${extensionNames}`;

const ok = "OK";
const disableInWorkspace = "Disable in Workspace";

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.

I feel like it's a little confusing whether this is referring to disabling the third party plugin/extension or the TS Native Preview extension.

Comment thread _extension/src/extension.ts Outdated

const ok = "OK";
const disableInWorkspace = "Disable in Workspace";
const dontShowAgain = hasWorkspaceFolder ? "Don't Show Again in Workspace" : "Don't Show Again";

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.

I apparently installed the Svelte extension years ago when playing around with something, and it seems to activate on all JS/TS projects, regardless of whether they use Svelte. It's going to be frustrating for me to have to click "Don't Show Again in Workspace" for every workspace I open. I'll personally just end up uninstalling the Svelte extension, but I would be in a bit of a bind if I did occasionally work on a Svelte project and needed to keep the extension installed. Maybe this is Svelte's fault for activating over-liberally, but I'm afraid lots of users are going to be constantly nagged about extensions they don't rely on heavily and aren't relevant to most of their workspaces. I feel like the global "Don't Show Again" should always be available.

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's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 7

Comment thread _extension/src/util.ts Outdated
Comment on lines +311 to +315
export function defer(fn: () => void): Disposable {
return {
[Symbol.dispose]: fn,
};
}
Comment thread _extension/src/extension.ts
Comment on lines +131 to +137
let pluginWarningShown = false;
const onDidChangeExtensions = vscode.extensions.onDidChange(() => {
warnAboutTsServerPlugins(context, output);
});
context.subscriptions.push(onDidChangeExtensions);
warnAboutTsServerPlugins(context, output);

Comment thread _extension/src/extension.ts
Comment thread _extension/l10n/bundle.l10n.json Outdated
Comment thread _extension/src/extension.ts Outdated
Comment on lines +175 to +176
// We only want to warn about plugins when Corsa is enabled in a user's the global configuration.
// Setting in the workspace is an indication that the user is aware of the potential issues.
Comment on lines +183 to +185
if (context.globalState.get<true>(pluginWarningDismissedKey)) {
return;
}
Merged via the queue into main with commit 481a4aa Jun 22, 2026
21 checks passed
Ryan Hart (rhart92) pushed a commit to rhart92/typescript-go that referenced this pull request Aug 2, 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.

Issue warning when extensions try to contribute TSServer plugins that while useTsgo is on

5 participants