diff --git a/extensions/vscode/README.md b/extensions/vscode/README.md index 9bdd0a42e2..7f40f9765f 100644 --- a/extensions/vscode/README.md +++ b/extensions/vscode/README.md @@ -277,6 +277,7 @@ Finally you need to make VS Code recognize your new extension and automatically | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------- | ----------------------------------- | | `vue.trace.server` | Traces the communication between VS Code and the language server. | `string` | `"off"` | | `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"` | +| `vue.server.compatibleExtensions` | Set compatible extensions to skip automatic detection of Hybrid Mode. | `array` | `[]` | | `vue.server.includeLanguages` | | `array` | `["vue"]` | | `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` | | `vue.doctor.status` | Show known problems in status bar. | `boolean` | `true` | diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 0da332a673..ffef22df47 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -274,6 +274,14 @@ ], "description": "Vue language server only handles CSS and HTML language support, and tsserver takes over TS language support via TS plugin." }, + "vue.server.compatibleExtensions": { + "type": "array", + "items": { + "type": "string" + }, + "default": [], + "description": "Set compatible extensions to skip automatic detection of Hybrid Mode." + }, "vue.server.includeLanguages": { "type": "array", "items": { diff --git a/extensions/vscode/src/compatibility.ts b/extensions/vscode/src/compatibility.ts index a0abe9aaac..61f52b9551 100644 --- a/extensions/vscode/src/compatibility.ts +++ b/extensions/vscode/src/compatibility.ts @@ -1,6 +1,7 @@ import { computed, useAllExtensions } from 'reactive-vscode'; import * as semver from 'semver'; import * as vscode from 'vscode'; +import { config } from './config'; const extensions = useAllExtensions(); @@ -39,6 +40,9 @@ function isExtensionCompatibleWithHybridMode(extension: vscode.Extension) { ) { return true; } + if (config.server.compatibleExtensions.includes(extension.id)) { + return true; + } if (extension.id === 'denoland.vscode-deno') { return !vscode.workspace.getConfiguration('deno').get('enable'); }