Skip to content

Warn on TSServer Plugin Contributions from other extensions#4063

Open
DanielRosenwasser wants to merge 11 commits into
mainfrom
warnOnPlugins
Open

Warn on TSServer Plugin Contributions from other extensions#4063
DanielRosenwasser wants to merge 11 commits into
mainfrom
warnOnPlugins

Conversation

@DanielRosenwasser
Copy link
Copy Markdown
Member

(Builds on #4052)

Fixes #3848.

@DanielRosenwasser DanielRosenwasser changed the title Warn on plugins Warn on TSServer Plugin Contributios from other extensions May 27, 2026
@DanielRosenwasser 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
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

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 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 DanielRosenwasser changed the title Warn on TSServer Plugin Contributios from other extensions Warn on TSServer Plugin Contributions from other extensions May 27, 2026
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 7.0 RC milestone May 28, 2026

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.`

: `${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.


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.

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

4 participants