Skip to content

Commit 24519aa

Browse files
committed
refactor(vscode) add premium feature settings
1 parent 5b47f4f commit 24519aa

File tree

3 files changed

+83
-11
lines changed

3 files changed

+83
-11
lines changed

extensions/vscode/lib/generated-meta.ts

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,27 @@
44
// Meta info
55
export const publisher = 'Vue';
66
export const name = 'volar';
7-
export const version = '3.0.0-beta.4';
7+
export const version = '3.0.1';
88
export const displayName = 'Vue (Official)';
99
export const description = 'Language Support for Vue';
1010
export const extensionId = `${publisher}.${name}`;
1111

1212
/**
1313
* Type union of all commands
1414
*/
15-
export type CommandKey = 'vue.action.restartServer';
15+
export type CommandKey =
16+
| 'vue.welcome'
17+
| 'vue.action.restartServer';
1618

1719
/**
1820
* Commands map registed by `Vue.volar`
1921
*/
2022
export const commands = {
23+
/**
24+
* %command.welcome%
25+
* @value `vue.welcome`
26+
*/
27+
welcome: 'vue.welcome',
2128
/**
2229
* %command.action.restartServer%
2330
* @value `vue.action.restartServer`
@@ -30,6 +37,9 @@ export const commands = {
3037
*/
3138
export type ConfigKey =
3239
| 'vue.trace.server'
40+
| 'vue.editor.focusMode'
41+
| 'vue.editor.reactivityVisualization'
42+
| 'vue.editor.templateInterpolationDecorators'
3343
| 'vue.server.includeLanguages'
3444
| 'vue.codeActions.askNewComponentName'
3545
| 'vue.suggest.componentNameCasing'
@@ -49,6 +59,9 @@ export type ConfigKey =
4959

5060
export interface ConfigKeyTypeMap {
5161
'vue.trace.server': 'off' | 'messages' | 'verbose';
62+
'vue.editor.focusMode': boolean;
63+
'vue.editor.reactivityVisualization': boolean;
64+
'vue.editor.templateInterpolationDecorators': boolean;
5265
'vue.server.includeLanguages': string[];
5366
'vue.codeActions.askNewComponentName': boolean;
5467
'vue.suggest.componentNameCasing': 'preferKebabCase' | 'preferPascalCase' | 'alwaysKebabCase' | 'alwaysPascalCase';
@@ -76,6 +89,9 @@ export interface ConfigKeyTypeMap {
7689

7790
export interface ConfigShorthandMap {
7891
traceServer: 'vue.trace.server';
92+
editorFocusMode: 'vue.editor.focusMode';
93+
editorReactivityVisualization: 'vue.editor.reactivityVisualization';
94+
editorTemplateInterpolationDecorators: 'vue.editor.templateInterpolationDecorators';
7995
serverIncludeLanguages: 'vue.server.includeLanguages';
8096
codeActionsAskNewComponentName: 'vue.codeActions.askNewComponentName';
8197
suggestComponentNameCasing: 'vue.suggest.componentNameCasing';
@@ -96,6 +112,9 @@ export interface ConfigShorthandMap {
96112

97113
export interface ConfigShorthandTypeMap {
98114
traceServer: 'off' | 'messages' | 'verbose';
115+
editorFocusMode: boolean;
116+
editorReactivityVisualization: boolean;
117+
editorTemplateInterpolationDecorators: boolean;
99118
serverIncludeLanguages: string[];
100119
codeActionsAskNewComponentName: boolean;
101120
suggestComponentNameCasing: 'preferKebabCase' | 'preferPascalCase' | 'alwaysKebabCase' | 'alwaysPascalCase';
@@ -139,6 +158,33 @@ export const configs = {
139158
key: 'vue.trace.server',
140159
default: 'off',
141160
} as ConfigItem<'vue.trace.server'>,
161+
/**
162+
* @key `vue.editor.focusMode`
163+
* @default `true`
164+
* @type `boolean`
165+
*/
166+
editorFocusMode: {
167+
key: 'vue.editor.focusMode',
168+
default: true,
169+
} as ConfigItem<'vue.editor.focusMode'>,
170+
/**
171+
* @key `vue.editor.reactivityVisualization`
172+
* @default `true`
173+
* @type `boolean`
174+
*/
175+
editorReactivityVisualization: {
176+
key: 'vue.editor.reactivityVisualization',
177+
default: true,
178+
} as ConfigItem<'vue.editor.reactivityVisualization'>,
179+
/**
180+
* @key `vue.editor.templateInterpolationDecorators`
181+
* @default `true`
182+
* @type `boolean`
183+
*/
184+
editorTemplateInterpolationDecorators: {
185+
key: 'vue.editor.templateInterpolationDecorators',
186+
default: true,
187+
} as ConfigItem<'vue.editor.templateInterpolationDecorators'>,
142188
/**
143189
* @key `vue.server.includeLanguages`
144190
* @default `["vue"]`
@@ -287,6 +333,9 @@ export const configs = {
287333

288334
export interface ScopedConfigKeyTypeMap {
289335
'trace.server': 'off' | 'messages' | 'verbose';
336+
'editor.focusMode': boolean;
337+
'editor.reactivityVisualization': boolean;
338+
'editor.templateInterpolationDecorators': boolean;
290339
'server.includeLanguages': string[];
291340
'codeActions.askNewComponentName': boolean;
292341
'suggest.componentNameCasing': 'preferKebabCase' | 'preferPascalCase' | 'alwaysKebabCase' | 'alwaysPascalCase';
@@ -316,6 +365,9 @@ export const scopedConfigs = {
316365
scope: 'vue',
317366
defaults: {
318367
'trace.server': 'off',
368+
'editor.focusMode': true,
369+
'editor.reactivityVisualization': true,
370+
'editor.templateInterpolationDecorators': true,
319371
'server.includeLanguages': ['vue'],
320372
'codeActions.askNewComponentName': true,
321373
'suggest.componentNameCasing': 'preferPascalCase',
@@ -340,6 +392,11 @@ export interface NestedConfigs {
340392
'trace': {
341393
'server': 'off' | 'messages' | 'verbose';
342394
};
395+
'editor': {
396+
'focusMode': boolean;
397+
'reactivityVisualization': boolean;
398+
'templateInterpolationDecorators': boolean;
399+
};
343400
'server': {
344401
'includeLanguages': string[];
345402
};
@@ -388,6 +445,11 @@ export interface NestedScopedConfigs {
388445
'trace': {
389446
'server': 'off' | 'messages' | 'verbose';
390447
};
448+
'editor': {
449+
'focusMode': boolean;
450+
'reactivityVisualization': boolean;
451+
'templateInterpolationDecorators': boolean;
452+
};
391453
'server': {
392454
'includeLanguages': string[];
393455
};

extensions/vscode/lib/welcome.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ export function activate() {
2323
case 'verifySponsor':
2424
vscode.commands.executeCommand('vue.action.verify');
2525
break;
26-
case 'openVideo':
27-
vscode.env.openExternal(
28-
vscode.Uri.parse(`https://www.youtube.com/watch?v=${message.id}`),
29-
);
30-
break;
3126
}
3227
});
3328

extensions/vscode/package.json

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,21 @@
237237
"default": "off",
238238
"markdownDescription": "%configuration.trace.server%"
239239
},
240+
"vue.editor.focusMode": {
241+
"type": "boolean",
242+
"default": true,
243+
"markdownDescription": "Sponsor this extension to unlock premium features. [Learn more](https://youtu.be/RcPcO4_Ct_U)"
244+
},
245+
"vue.editor.reactivityVisualization": {
246+
"type": "boolean",
247+
"default": true,
248+
"markdownDescription": "Sponsor this extension to unlock premium features. [Learn more](https://youtu.be/RcPcO4_Ct_U)"
249+
},
250+
"vue.editor.templateInterpolationDecorators": {
251+
"type": "boolean",
252+
"default": true,
253+
"markdownDescription": "Sponsor this extension to unlock premium features. [Learn more](https://youtu.be/RcPcO4_Ct_U)"
254+
},
240255
"vue.server.includeLanguages": {
241256
"type": "array",
242257
"items": {
@@ -359,13 +374,13 @@
359374
},
360375
"commands": [
361376
{
362-
"command": "vue.action.restartServer",
363-
"title": "%command.action.restartServer%",
377+
"command": "vue.welcome",
378+
"title": "%command.welcome%",
364379
"category": "Vue"
365380
},
366381
{
367-
"command": "vue.welcome",
368-
"title": "%command.welcome%",
382+
"command": "vue.action.restartServer",
383+
"title": "%command.action.restartServer%",
369384
"category": "Vue"
370385
}
371386
],

0 commit comments

Comments
 (0)