From 60e7817e9cc27e41c0dd4720d41feb74cf2eb989 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Mon, 31 May 2021 21:37:08 +0300 Subject: Fix opening single files --- editors/code/src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'editors') diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index d26273246..74ee28d24 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -45,7 +45,7 @@ async function tryActivate(context: vscode.ExtensionContext) { throw new Error(message); }); - if (vscode.workspace.workspaceFolders?.length === 0) { + if ((vscode.workspace.workspaceFolders || []).length === 0) { const rustDocuments = vscode.workspace.textDocuments.filter(document => isRustDocument(document)); if (rustDocuments.length > 0) { ctx = await Ctx.create(config, context, serverPath, { kind: 'Detached Files', files: rustDocuments }); -- cgit v1.2.3