Skip to content
Merged
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion _extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ import { setupVersionStatusItem } from "./versionStatusItem";
export async function activate(context: vscode.ExtensionContext) {
await vscode.commands.executeCommand("setContext", "typescript.native-preview.serverRunning", false);

const majorVersion = parseInt(vscode.version.split(".")[0]);
const minorVersion = parseInt(vscode.version.split(".")[1]);
const needsExtHostRestartOnChange = majorVersion <= 1 && minorVersion < 105;

const output = vscode.window.createOutputChannel("typescript-native-preview", "log");
const traceOutput = vscode.window.createOutputChannel("typescript-native-preview (LSP)");
const client = new Client(output, traceOutput);
registerCommands(context, client, output, traceOutput);

context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(event => {
if (event.affectsConfiguration("typescript.experimental.useTsgo")) {
if (needsExtHostRestartOnChange && event.affectsConfiguration("typescript.experimental.useTsgo")) {
// Delay because the command to change the config setting will restart
// the extension host, so no need to show a message
setTimeout(async () => {
Expand Down
Loading