Skip to content

Commit 1ce2a0d

Browse files
committed
fix(editor): don't allow oxc.path.server for untrusted workspaces
1 parent 4b0be04 commit 1ce2a0d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

editors/vscode/client/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export async function activate(context: ExtensionContext) {
139139

140140
async function findBinary(): Promise<string> {
141141
let bin = configService.getUserServerBinPath();
142-
if (bin) {
142+
if (workspace.isTrusted && bin) {
143143
try {
144144
await fsPromises.access(bin);
145145
return bin;

editors/vscode/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,15 @@
178178
}
179179
]
180180
},
181+
"capabilities": {
182+
"untrustedWorkspaces": {
183+
"supported": "limited",
184+
"description": "The Extension will always use the Language Server shipped with the Extension.",
185+
"restrictedConfigurations": [
186+
"oxc.path.server"
187+
]
188+
}
189+
},
181190
"scripts": {
182191
"preinstall": "[ -f icon.png ] || curl https://cdn.jsdelivr.net/gh/oxc-project/oxc-assets/square.png --output icon.png",
183192
"build": "pnpm run server:build:release && pnpm run compile && pnpm run package",

0 commit comments

Comments
 (0)