Skip to content

Commit 96b621a

Browse files
refactor(vscode): remove split editor feature (#5446)
1 parent 8654367 commit 96b621a

File tree

7 files changed

+2
-236
lines changed

7 files changed

+2
-236
lines changed
File renamed without changes.
-1.21 KB
Binary file not shown.

extensions/vscode/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
} from 'reactive-vscode';
1717
import * as vscode from 'vscode';
1818
import { config } from './lib/config';
19-
import { activate as activateSplitEditors } from './lib/splitEditors';
2019

2120
let client: lsp.BaseLanguageClient | undefined;
2221

@@ -71,7 +70,6 @@ export const { activate, deactivate } = defineExtension(async () => {
7170

7271
activateAutoInsertion(selectors, client);
7372
activateDocumentDropEdit(selectors, client);
74-
activateSplitEditors(client);
7573
}, { immediate: true });
7674

7775
useCommand('vue.action.restartServer', async () => {

extensions/vscode/lib/generated-meta.ts

Lines changed: 1 addition & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ export const extensionId = `${publisher}.${name}`;
1212
/**
1313
* Type union of all commands
1414
*/
15-
export type CommandKey =
16-
| 'vue.action.restartServer'
17-
| 'vue.action.splitEditors';
15+
export type CommandKey = 'vue.action.restartServer';
1816

1917
/**
2018
* Commands map registed by `Vue.volar`
@@ -25,11 +23,6 @@ export const commands = {
2523
* @value `vue.action.restartServer`
2624
*/
2725
actionRestartServer: 'vue.action.restartServer',
28-
/**
29-
* %command.action.splitEditors%
30-
* @value `vue.action.splitEditors`
31-
*/
32-
actionSplitEditors: 'vue.action.splitEditors',
3326
} satisfies Record<string, CommandKey>;
3427

3528
/**
@@ -38,9 +31,6 @@ export const commands = {
3831
export type ConfigKey =
3932
| 'vue.trace.server'
4033
| 'vue.server.includeLanguages'
41-
| 'vue.splitEditors.icon'
42-
| 'vue.splitEditors.layout.left'
43-
| 'vue.splitEditors.layout.right'
4434
| 'vue.codeActions.askNewComponentName'
4535
| 'vue.complete.casing.tags'
4636
| 'vue.complete.casing.props'
@@ -60,9 +50,6 @@ export type ConfigKey =
6050
export interface ConfigKeyTypeMap {
6151
'vue.trace.server': 'off' | 'messages' | 'verbose';
6252
'vue.server.includeLanguages': string[];
63-
'vue.splitEditors.icon': boolean;
64-
'vue.splitEditors.layout.left': string[];
65-
'vue.splitEditors.layout.right': string[];
6653
'vue.codeActions.askNewComponentName': boolean;
6754
'vue.complete.casing.tags': 'autoKebab' | 'autoPascal' | 'kebab' | 'pascal';
6855
'vue.complete.casing.props': 'autoKebab' | 'autoCamel' | 'kebab' | 'camel';
@@ -90,9 +77,6 @@ export interface ConfigKeyTypeMap {
9077
export interface ConfigShorthandMap {
9178
traceServer: 'vue.trace.server';
9279
serverIncludeLanguages: 'vue.server.includeLanguages';
93-
splitEditorsIcon: 'vue.splitEditors.icon';
94-
splitEditorsLayoutLeft: 'vue.splitEditors.layout.left';
95-
splitEditorsLayoutRight: 'vue.splitEditors.layout.right';
9680
codeActionsAskNewComponentName: 'vue.codeActions.askNewComponentName';
9781
completeCasingTags: 'vue.complete.casing.tags';
9882
completeCasingProps: 'vue.complete.casing.props';
@@ -113,9 +97,6 @@ export interface ConfigShorthandMap {
11397
export interface ConfigShorthandTypeMap {
11498
traceServer: 'off' | 'messages' | 'verbose';
11599
serverIncludeLanguages: string[];
116-
splitEditorsIcon: boolean;
117-
splitEditorsLayoutLeft: string[];
118-
splitEditorsLayoutRight: string[];
119100
codeActionsAskNewComponentName: boolean;
120101
completeCasingTags: 'autoKebab' | 'autoPascal' | 'kebab' | 'pascal';
121102
completeCasingProps: 'autoKebab' | 'autoCamel' | 'kebab' | 'camel';
@@ -167,33 +148,6 @@ export const configs = {
167148
key: 'vue.server.includeLanguages',
168149
default: ['vue'],
169150
} as ConfigItem<'vue.server.includeLanguages'>,
170-
/**
171-
* @key `vue.splitEditors.icon`
172-
* @default `false`
173-
* @type `boolean`
174-
*/
175-
splitEditorsIcon: {
176-
key: 'vue.splitEditors.icon',
177-
default: false,
178-
} as ConfigItem<'vue.splitEditors.icon'>,
179-
/**
180-
* @key `vue.splitEditors.layout.left`
181-
* @default `["script","scriptSetup","styles"]`
182-
* @type `array`
183-
*/
184-
splitEditorsLayoutLeft: {
185-
key: 'vue.splitEditors.layout.left',
186-
default: ['script', 'scriptSetup', 'styles'],
187-
} as ConfigItem<'vue.splitEditors.layout.left'>,
188-
/**
189-
* @key `vue.splitEditors.layout.right`
190-
* @default `["template","customBlocks"]`
191-
* @type `array`
192-
*/
193-
splitEditorsLayoutRight: {
194-
key: 'vue.splitEditors.layout.right',
195-
default: ['template', 'customBlocks'],
196-
} as ConfigItem<'vue.splitEditors.layout.right'>,
197151
/**
198152
* @key `vue.codeActions.askNewComponentName`
199153
* @default `true`
@@ -334,9 +288,6 @@ export const configs = {
334288
export interface ScopedConfigKeyTypeMap {
335289
'trace.server': 'off' | 'messages' | 'verbose';
336290
'server.includeLanguages': string[];
337-
'splitEditors.icon': boolean;
338-
'splitEditors.layout.left': string[];
339-
'splitEditors.layout.right': string[];
340291
'codeActions.askNewComponentName': boolean;
341292
'complete.casing.tags': 'autoKebab' | 'autoPascal' | 'kebab' | 'pascal';
342293
'complete.casing.props': 'autoKebab' | 'autoCamel' | 'kebab' | 'camel';
@@ -366,9 +317,6 @@ export const scopedConfigs = {
366317
defaults: {
367318
'trace.server': 'off',
368319
'server.includeLanguages': ['vue'],
369-
'splitEditors.icon': false,
370-
'splitEditors.layout.left': ['script', 'scriptSetup', 'styles'],
371-
'splitEditors.layout.right': ['template', 'customBlocks'],
372320
'codeActions.askNewComponentName': true,
373321
'complete.casing.tags': 'autoPascal',
374322
'complete.casing.props': 'autoKebab',
@@ -395,13 +343,6 @@ export interface NestedConfigs {
395343
'server': {
396344
'includeLanguages': string[];
397345
};
398-
'splitEditors': {
399-
'icon': boolean;
400-
'layout': {
401-
'left': string[];
402-
'right': string[];
403-
};
404-
};
405346
'codeActions': {
406347
'askNewComponentName': boolean;
407348
};
@@ -452,13 +393,6 @@ export interface NestedScopedConfigs {
452393
'server': {
453394
'includeLanguages': string[];
454395
};
455-
'splitEditors': {
456-
'icon': boolean;
457-
'layout': {
458-
'left': string[];
459-
'right': string[];
460-
};
461-
};
462396
'codeActions': {
463397
'askNewComponentName': boolean;
464398
};

extensions/vscode/lib/splitEditors.ts

Lines changed: 0 additions & 111 deletions
This file was deleted.

extensions/vscode/package.json

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"sponsor": {
1414
"url": "https://github.com/sponsors/johnsoncodehk"
1515
},
16-
"icon": "images/icon.png",
16+
"icon": "icon.png",
1717
"displayName": "Vue (Official)",
1818
"description": "Language Support for Vue",
1919
"author": "johnsoncodehk",
@@ -251,34 +251,6 @@
251251
],
252252
"markdownDescription": "%configuration.server.includeLanguages%"
253253
},
254-
"vue.splitEditors.icon": {
255-
"type": "boolean",
256-
"default": false,
257-
"markdownDescription": "%configuration.splitEditors.icon%"
258-
},
259-
"vue.splitEditors.layout.left": {
260-
"type": "array",
261-
"items": {
262-
"type": "string"
263-
},
264-
"default": [
265-
"script",
266-
"scriptSetup",
267-
"styles"
268-
],
269-
"markdownDescription": "%configuration.splitEditors.layout.left%"
270-
},
271-
"vue.splitEditors.layout.right": {
272-
"type": "array",
273-
"items": {
274-
"type": "string"
275-
},
276-
"default": [
277-
"template",
278-
"customBlocks"
279-
],
280-
"markdownDescription": "%configuration.splitEditors.layout.right%"
281-
},
282254
"vue.codeActions.askNewComponentName": {
283255
"type": "boolean",
284256
"default": true,
@@ -394,12 +366,6 @@
394366
"command": "vue.action.restartServer",
395367
"title": "%command.action.restartServer%",
396368
"category": "Vue"
397-
},
398-
{
399-
"command": "vue.action.splitEditors",
400-
"title": "%command.action.splitEditors%",
401-
"category": "Vue",
402-
"icon": "images/split-editors.png"
403369
}
404370
],
405371
"menus": {
@@ -439,17 +405,6 @@
439405
{
440406
"command": "typescript.removeUnusedImports",
441407
"when": "supportedCodeAction =~ /(\\s|^)source\\.removeUnusedImports\\b/ && editorLangId =~ /^vue$/"
442-
},
443-
{
444-
"command": "vue.action.splitEditors",
445-
"when": "editorLangId == vue"
446-
}
447-
],
448-
"editor/title": [
449-
{
450-
"command": "vue.action.splitEditors",
451-
"when": "resourceLangId == vue && config.vue.splitEditors.icon",
452-
"group": "navigation"
453408
}
454409
]
455410
}

packages/language-server/index.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
forEachEmbeddedCode,
1010
getDefaultCompilerOptions,
1111
isReferencesEnabled,
12-
parse,
1312
} from '@vue/language-core';
1413
import {
1514
createLanguageService,
@@ -204,15 +203,6 @@ connection.onInitialized(server.initialized);
204203

205204
connection.onShutdown(server.shutdown);
206205

207-
connection.onRequest('vue/parseSfc', (params: {
208-
textDocument: TextDocumentIdentifier;
209-
}) => {
210-
const document = server.documents.get(URI.parse(params.textDocument.uri));
211-
if (document) {
212-
return parse(document.getText());
213-
}
214-
});
215-
216206
connection.onRequest('vue/interpolationRanges', async (params: {
217207
textDocument: TextDocumentIdentifier;
218208
}): Promise<[number, number][]> => {

0 commit comments

Comments
 (0)