Skip to content

Commit 6f32f57

Browse files
authored
feat(vscode): add configuration for skipping automatic detection of Hybrid Mode (#5046)
1 parent f368235 commit 6f32f57

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

extensions/vscode/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ Finally you need to make VS Code recognize your new extension and automatically
277277
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------- | ----------------------------------- |
278278
| `vue.trace.server` | Traces the communication between VS Code and the language server. | `string` | `"off"` |
279279
| `vue.server.hybridMode` | Vue language server only handles CSS and HTML language support, and tsserver takes over TS language support via TS plugin. | `boolean,string` | `"auto"` |
280+
| `vue.server.compatibleExtensions` | Set compatible extensions to skip automatic detection of Hybrid Mode. | `array` | `[]` |
280281
| `vue.server.includeLanguages` | | `array` | `["vue"]` |
281282
| `vue.server.maxOldSpaceSize` | Set --max-old-space-size option on server process. If you have problem on frequently "Request textDocument/** failed." error, try setting higher memory(MB) on it. | `number,null` | `null` |
282283
| `vue.doctor.status` | Show known problems in status bar. | `boolean` | `true` |

extensions/vscode/package.json

+8
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,14 @@
274274
],
275275
"description": "Vue language server only handles CSS and HTML language support, and tsserver takes over TS language support via TS plugin."
276276
},
277+
"vue.server.compatibleExtensions": {
278+
"type": "array",
279+
"items": {
280+
"type": "string"
281+
},
282+
"default": [],
283+
"description": "Set compatible extensions to skip automatic detection of Hybrid Mode."
284+
},
277285
"vue.server.includeLanguages": {
278286
"type": "array",
279287
"items": {

extensions/vscode/src/compatibility.ts

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { computed, useAllExtensions } from 'reactive-vscode';
22
import * as semver from 'semver';
33
import * as vscode from 'vscode';
4+
import { config } from './config';
45

56
const extensions = useAllExtensions();
67

@@ -39,6 +40,9 @@ function isExtensionCompatibleWithHybridMode(extension: vscode.Extension<any>) {
3940
) {
4041
return true;
4142
}
43+
if (config.server.compatibleExtensions.includes(extension.id)) {
44+
return true;
45+
}
4246
if (extension.id === 'denoland.vscode-deno') {
4347
return !vscode.workspace.getConfiguration('deno').get<boolean>('enable');
4448
}

0 commit comments

Comments
 (0)