diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index ae14523479..e9b62e0cc2 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -51,14 +51,14 @@ async function tryActivate(context: vscode.ExtensionContext): Promise - folder.uri.scheme == "file" + const folders = (vscode.workspace.workspaceFolders || []).filter( + (folder) => folder.uri.scheme === "file" ); const rustDocuments = vscode.workspace.textDocuments.filter((document) => isRustDocument(document) ); - if (folders.length == 0 && rustDocuments.length == 0) { + if (folders.length === 0 && rustDocuments.length === 0) { // FIXME: Ideally we would choose not to activate at all (and avoid registering // non-functional editor commands), but VS Code doesn't seem to have a good way of doing // that