Skip to content

Commit 9f8043c

Browse files
committed
feat: show takeover enabled on ts version status
close #1294
1 parent 0b7dd8c commit 9f8043c

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

extensions/vscode-vue-language-features/src/common.ts

-10
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,6 @@ async function doActivate(context: vscode.ExtensionContext, createLc: CreateLang
6363
vscode.commands.executeCommand('setContext', 'volar.activated', true);
6464

6565
const takeOverMode = takeOverModeEnabled();
66-
if (takeOverMode) {
67-
vscode.window
68-
.showInformationMessage('Take Over Mode enabled.', 'What is Take Over Mode?')
69-
.then(option => {
70-
if (option !== undefined) {
71-
vscode.env.openExternal(vscode.Uri.parse('https://github.com/johnsoncodehk/volar/discussions/471'));
72-
}
73-
});
74-
}
75-
7666
const languageFeaturesDocumentSelector: lsp.DocumentSelector = takeOverMode ?
7767
[
7868
{ scheme: 'file', language: 'vue' },

extensions/vscode-vue-language-features/src/features/tsVersion.ts

+13
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,21 @@ export async function activate(context: vscode.ExtensionContext, clients: Common
4141
detail: defaultTsdk,
4242
};
4343
}
44+
if (takeOverModeEnabled()) {
45+
options[3] = {
46+
label: 'What is Takeover Mode?',
47+
};
48+
}
4449

4550
const select = await userPick(options);
4651
if (select === undefined)
4752
return; // cancel
4853

54+
if (select === '3') {
55+
vscode.env.openExternal(vscode.Uri.parse('https://vuejs.org/guide/typescript/overview.html#takeover-mode'));
56+
return;
57+
}
58+
4959
if (select === '2') {
5060
vscode.workspace.getConfiguration('typescript').update('tsdk', defaultTsdk);
5161
}
@@ -89,6 +99,9 @@ export async function activate(context: vscode.ExtensionContext, clients: Common
8999
const tsPaths = getCurrentTsPaths(context);
90100
const tsVersion = shared.getTypeScriptVersion(tsPaths.serverPath);
91101
statusBar.text = 'TS ' + tsVersion;
102+
if (takeOverModeEnabled()) {
103+
statusBar.text += ' (takeover)';
104+
}
92105
statusBar.show();
93106
}
94107
}

0 commit comments

Comments
 (0)