aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-05-31 19:38:15 +0100
committerGitHub <[email protected]>2021-05-31 19:38:15 +0100
commita127b10d0087c19c299ccfcb5b9f3af4615411f8 (patch)
tree3f6dd5bb4992b999a8cc2ed13d9ad827c9cba568
parent7c1d8ca63510bb719fd91bbf38692e45b19c04d6 (diff)
parent60e7817e9cc27e41c0dd4720d41feb74cf2eb989 (diff)
Merge #9091
9091: Fix opening single files r=SomeoneToIgnore a=SomeoneToIgnore Closes https://github.com/rust-analyzer/rust-analyzer/issues/9082 Co-authored-by: Kirill Bulatov <[email protected]>
-rw-r--r--editors/code/src/main.ts2
1 files changed, 1 insertions, 1 deletions
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) {
45 throw new Error(message); 45 throw new Error(message);
46 }); 46 });
47 47
48 if (vscode.workspace.workspaceFolders?.length === 0) { 48 if ((vscode.workspace.workspaceFolders || []).length === 0) {
49 const rustDocuments = vscode.workspace.textDocuments.filter(document => isRustDocument(document)); 49 const rustDocuments = vscode.workspace.textDocuments.filter(document => isRustDocument(document));
50 if (rustDocuments.length > 0) { 50 if (rustDocuments.length > 0) {
51 ctx = await Ctx.create(config, context, serverPath, { kind: 'Detached Files', files: rustDocuments }); 51 ctx = await Ctx.create(config, context, serverPath, { kind: 'Detached Files', files: rustDocuments });