diff --git a/extensions/typescript-language-features/package.json b/extensions/typescript-language-features/package.json index 95e68483788..8fe4ce52696 100644 --- a/extensions/typescript-language-features/package.json +++ b/extensions/typescript-language-features/package.json @@ -202,11 +202,12 @@ "description": "%typescript.implementationsCodeLens.enabled%", "scope": "window" }, - "typescript.useTsgo": { + "typescript.experimental.useTsgo": { "type": "boolean", "default": false, "markdownDescription": "%typescript.useTsgo%", - "scope": "window" + "scope": "window", + "tags": ["experimental"] }, "typescript.implementationsCodeLens.showOnInterfaceMethods": { "type": "boolean", @@ -1634,16 +1635,16 @@ "category": "JavaScript" }, { - "command": "typescript.enableTsgo", - "title": "Use TypeScript Go", + "command": "typescript.experimental.enableTsgo", + "title": "Use TypeScript Go (Experimental)", "category": "TypeScript", - "enablement": "!config.typescript.useTsgo && config.typescript-go.executablePath" + "enablement": "!config.typescript.experimental.useTsgo && config.typescript-go.executablePath" }, { - "command": "typescript.disableTsgo", - "title": "Stop using TypeScript Go", + "command": "typescript.experimental.disableTsgo", + "title": "Stop using TypeScript Go (Experimental)", "category": "TypeScript", - "enablement": "config.typescript.useTsgo" + "enablement": "config.typescript.experimental.useTsgo" } ], "menus": { diff --git a/extensions/typescript-language-features/src/commands/useTsgo.ts b/extensions/typescript-language-features/src/commands/useTsgo.ts index 5c43381f729..34aaf5dcb60 100644 --- a/extensions/typescript-language-features/src/commands/useTsgo.ts +++ b/extensions/typescript-language-features/src/commands/useTsgo.ts @@ -7,7 +7,7 @@ import * as vscode from 'vscode'; import { Command } from './commandManager'; export class EnableTsgoCommand implements Command { - public readonly id = 'typescript.enableTsgo'; + public readonly id = 'typescript.experimental.enableTsgo'; public async execute(): Promise { await updateTsgoSetting(true); @@ -15,7 +15,7 @@ export class EnableTsgoCommand implements Command { } export class DisableTsgoCommand implements Command { - public readonly id = 'typescript.disableTsgo'; + public readonly id = 'typescript.experimental.disableTsgo'; public async execute(): Promise { await updateTsgoSetting(false); @@ -31,7 +31,7 @@ async function updateTsgoSetting(enable: boolean): Promise { // Error if the TypeScript Go extension is not installed with a button to open the GitHub repo if (!tsgoExtension) { return vscode.window.showErrorMessage( - 'The TypeScript Go extension is not installed.', + vscode.l10n.t('The TypeScript Go extension is not installed.'), { title: 'Open on GitHub', isCloseAffordance: true, @@ -44,14 +44,14 @@ async function updateTsgoSetting(enable: boolean): Promise { } const tsConfig = vscode.workspace.getConfiguration('typescript'); - const currentValue = tsConfig.get('useTsgo', false); + const currentValue = tsConfig.get('experimental.useTsgo', false); if (currentValue === enable) { return; } // Determine the target scope for the configuration update let target = vscode.ConfigurationTarget.Global; - const inspect = tsConfig.inspect('useTsgo'); + const inspect = tsConfig.inspect('experimental.useTsgo'); if (inspect?.workspaceValue !== undefined) { target = vscode.ConfigurationTarget.Workspace; } else if (inspect?.workspaceFolderValue !== undefined) { @@ -69,6 +69,6 @@ async function updateTsgoSetting(enable: boolean): Promise { } // Update the setting, restart the extension host, and enable the TypeScript Go extension - await tsConfig.update('useTsgo', enable, target); + await tsConfig.update('experimental.useTsgo', enable, target); await vscode.commands.executeCommand('workbench.action.restartExtensionHost'); } diff --git a/extensions/typescript-language-features/src/extension.ts b/extensions/typescript-language-features/src/extension.ts index ab22d8bef3b..29f809bd653 100644 --- a/extensions/typescript-language-features/src/extension.ts +++ b/extensions/typescript-language-features/src/extension.ts @@ -34,7 +34,7 @@ export function activate( // Disable extension if using the experimental TypeScript Go extension const config = vscode.workspace.getConfiguration('typescript'); - const useTsgo = config.get('useTsgo', false); + const useTsgo = config.get('experimental.useTsgo', false); if (useTsgo) { commandManager.register(new DisableTsgoCommand());