Warn on TSServer Plugin Contributions from other extensions#4063
Warn on TSServer Plugin Contributions from other extensions#4063DanielRosenwasser wants to merge 11 commits into
Conversation
…js/ts over typescript.
…dence and resolution
| const settingName = getWinningTsgoConfigKey()!; | ||
| assert(settingName !== undefined, "Expected some useTsgo configuration to be explicitly set."); | ||
|
|
||
| const target = getExplicitConfigTarget(vscode.workspace.getConfiguration(), settingName); |
| warnAboutTsServerPlugins(context, output); | ||
| context.subscriptions.push(vscode.extensions.onDidChange(() => { | ||
| warnAboutTsServerPlugins(context, output); |
| 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); |
There was a problem hiding this comment.
Maybe we should just have some state so we don't show it more than once per session.
|
|
||
| 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.` |
There was a problem hiding this comment.
The plugin name could use some quotes to lessen the "plugin plugin" effect
| ? `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"; |
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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.
(Builds on #4052)
Fixes #3848.