aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/debug.ts
diff options
context:
space:
mode:
authorvsrs <[email protected]>2021-04-22 14:09:46 +0100
committervsrs <[email protected]>2021-04-22 14:09:46 +0100
commit1ebfe11730191e914dcf20297cdfdac5b7c297fc (patch)
treeae6caf9e8fd50e3eac826d0a3f0698c6e047544f /editors/code/src/debug.ts
parent8f781e782c7e16aa323672620753ec31526d2b90 (diff)
Add special `auto` value for `debug.sourceFileMap`
Diffstat (limited to 'editors/code/src/debug.ts')
-rw-r--r--editors/code/src/debug.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/editors/code/src/debug.ts b/editors/code/src/debug.ts
index fe8ec1be4..8c6969dc6 100644
--- a/editors/code/src/debug.ts
+++ b/editors/code/src/debug.ts
@@ -3,7 +3,7 @@ import * as vscode from 'vscode';
3import * as path from 'path'; 3import * as path from 'path';
4import * as ra from './lsp_ext'; 4import * as ra from './lsp_ext';
5 5
6import { Cargo, sysrootForDir as getSysroot } from './toolchain'; 6import { Cargo, getSysroot } from './toolchain';
7import { Ctx } from "./ctx"; 7import { Ctx } from "./ctx";
8import { prepareEnv } from "./run"; 8import { prepareEnv } from "./run";
9 9
@@ -105,11 +105,11 @@ async function getDebugConfiguration(ctx: Ctx, runnable: ra.Runnable): Promise<v
105 const executable = await getDebugExecutable(runnable); 105 const executable = await getDebugExecutable(runnable);
106 const env = prepareEnv(runnable, ctx.config.runnableEnv); 106 const env = prepareEnv(runnable, ctx.config.runnableEnv);
107 let sourceFileMap = debugOptions.sourceFileMap; 107 let sourceFileMap = debugOptions.sourceFileMap;
108 if ( !sourceFileMap || Object.keys(sourceFileMap).length === 0 ) { 108 if (sourceFileMap === "auto") {
109 // let's try to use the default toolchain 109 // let's try to use the default toolchain
110 const sysroot = await getSysroot(wsFolder); 110 const sysroot = await getSysroot(wsFolder);
111 const rustlib_src = path.normalize(sysroot + "/lib/rustlib/src/rust"); 111 const rustlib = path.normalize(sysroot + "/lib/rustlib/src/rust");
112 sourceFileMap = { "/rustc/*": rustlib_src }; 112 sourceFileMap = { "/rustc/*": rustlib };
113 } 113 }
114 114
115 const debugConfig = knownEngines[debugEngine.id](runnable, simplifyPath(executable), env, sourceFileMap); 115 const debugConfig = knownEngines[debugEngine.id](runnable, simplifyPath(executable), env, sourceFileMap);