Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .vscode/launch.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
"name": "Launch VS Code extension",
"runtimeExecutable": "${execPath}",
"args": [
"--disable-extension=vscode.typescript-language-features",
"--disable-extension=ms-vscode.vscode-typescript-next",
"--extensionDevelopmentPath=${workspaceRoot}/_extension"
],
"outFiles": [
Expand Down
30 changes: 22 additions & 8 deletions _extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,33 @@ export async function activate(context: vscode.ExtensionContext) {
}));

const useTsgo = vscode.workspace.getConfiguration("typescript").get<boolean>("experimental.useTsgo");
if (!useTsgo) {
if (context.extensionMode === vscode.ExtensionMode.Development) {
if (useTsgo === false) {
vscode.window.showInformationMessage(
'TypeScript Native Preview is running in development mode. Ignoring "typescript.experimental.useTsgo": false.',

if (context.extensionMode === vscode.ExtensionMode.Development) {
const tsExtension = vscode.extensions.getExtension("vscode.typescript-language-features");
if (!tsExtension) {
if (!useTsgo) {
vscode.window.showWarningMessage(
"The built-in TypeScript extension is disabled. Sync launch.json with launch.template.json to reenable.",
Copy link

Copilot AI Nov 25, 2025

Choose a reason for hiding this comment

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

When the TypeScript extension is disabled and useTsgo is explicitly set to false, the warning message suggests syncing launch.json but doesn't clearly explain that tsgo will be activated anyway (overriding the user's setting). Consider making the message more explicit about this behavior, e.g., "The built-in TypeScript extension is disabled. TypeScript Native Preview will be forced to run. Sync launch.json with launch.template.json to allow the main extension to handle TypeScript."

Suggested change
"The built-in TypeScript extension is disabled. Sync launch.json with launch.template.json to reenable.",
"The built-in TypeScript extension is disabled. TypeScript Native Preview will be forced to run, overriding your 'typescript.experimental.useTsgo' setting. Sync launch.json with launch.template.json to allow the main extension to handle TypeScript.",

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, well I could make it full return if that's what @andrewbranch meant

Copy link
Member

Choose a reason for hiding this comment

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

Nah this is fine

"OK",
);
}
}
else {
output.appendLine("TypeScript Native Preview is disabled. Select 'Enable TypeScript Native Preview (Experimental)' in the command palette to enable it.");
return;
else if (useTsgo === false) {
vscode.window.showWarningMessage(
'TypeScript Native Preview is running in development mode with "typescript.experimental.useTsgo" set to false.',
"Enable Setting",
"Ignore",
).then(selected => {
if (selected === "Enable Setting") {
vscode.commands.executeCommand("typescript.native-preview.enable");
}
});
}
}
else if (!useTsgo) {
output.appendLine("TypeScript Native Preview is disabled. Select 'Enable TypeScript Native Preview (Experimental)' in the command palette to enable it.");
return;
}

disposeLanguageFeatures = await activateLanguageFeatures(context, output, traceOutput);
context.subscriptions.push(disposeLanguageFeatures);
Expand Down
Loading