about summary refs log tree commit diff
path: root/editors/code/src/debug.ts
diff options
context:
space:
mode:
authorSahandevs <sahandevs@gmail.com>2021-02-07 22:06:16 +0330
committerSahandevs <sahandevs@gmail.com>2021-02-07 22:06:16 +0330
commit2f82a84d2a06e24296bdbc4e8f50131539d5a749 (patch)
tree302b1d5a48f84d1b41ff9d0296597fc701bd6558 /editors/code/src/debug.ts
parent3a0234d60f924cdec4a3fa2fccfe7ed85567f0bc (diff)
downloadrust-2f82a84d2a06e24296bdbc4e8f50131539d5a749.tar.gz
rust-2f82a84d2a06e24296bdbc4e8f50131539d5a749.zip
fix errors
Diffstat (limited to 'editors/code/src/debug.ts')
-rw-r--r--editors/code/src/debug.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/editors/code/src/debug.ts b/editors/code/src/debug.ts
index 3c113e46eb2..c72a7b27888 100644
--- a/editors/code/src/debug.ts
+++ b/editors/code/src/debug.ts
@@ -87,12 +87,14 @@ async function getDebugConfiguration(ctx: Ctx, runnable: ra.Runnable): Promise<v
     if (ctx.config.debug.openDebugPane) {
         debugOutput.show(true);
     }
-
-    const isMultiFolderWorkspace = vscode.workspace.workspaceFolders.length > 1;
-    const firstWorkspace = vscode.workspace.workspaceFolders[0]; // folder exists or RA is not active.
+    // folder exists or RA is not active.
+    // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
+    const workspaceFolders = vscode.workspace.workspaceFolders!;
+    const isMultiFolderWorkspace = workspaceFolders.length > 1;
+    const firstWorkspace = workspaceFolders[0];
     const workspace = !isMultiFolderWorkspace || !runnable.args.workspaceRoot ?
         firstWorkspace :
-        vscode.workspace.workspaceFolders.find(w => runnable.args.workspaceRoot?.includes(w.uri.fsPath)) || firstWorkspace;
+        workspaceFolders.find(w => runnable.args.workspaceRoot?.includes(w.uri.fsPath)) || firstWorkspace;
 
     const wsFolder = path.normalize(workspace.uri.fsPath);
     const workspaceQualifier = isMultiFolderWorkspace ? `:${workspace.name}` : '';