Skip to content

Commit

Permalink
feat(vscode): add configuration for skipping automatic detection of H…
Browse files Browse the repository at this point in the history
…ybrid Mode (#5046)
  • Loading branch information
KazariEX authored Dec 13, 2024
1 parent f368235 commit 6f32f57
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions extensions/vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down
8 changes: 8 additions & 0 deletions extensions/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 4 additions & 0 deletions extensions/vscode/src/compatibility.ts
Original file line number Diff line number Diff line change
@@ -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();

Expand Down Expand Up @@ -39,6 +40,9 @@ function isExtensionCompatibleWithHybridMode(extension: vscode.Extension<any>) {
) {
return true;
}
if (config.server.compatibleExtensions.includes(extension.id)) {
return true;
}
if (extension.id === 'denoland.vscode-deno') {
return !vscode.workspace.getConfiguration('deno').get<boolean>('enable');
}
Expand Down

0 comments on commit 6f32f57

Please sign in to comment.