about summary refs log tree commit diff
path: root/editors/code/src/debug.ts
diff options
context:
space:
mode:
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}` : '';