diff options
| author | vsrs <vit@conrlab.com> | 2021-04-22 16:09:46 +0300 |
|---|---|---|
| committer | vsrs <vit@conrlab.com> | 2021-04-22 16:09:46 +0300 |
| commit | 1ebfe11730191e914dcf20297cdfdac5b7c297fc (patch) | |
| tree | ae6caf9e8fd50e3eac826d0a3f0698c6e047544f /editors/code/src/debug.ts | |
| parent | 8f781e782c7e16aa323672620753ec31526d2b90 (diff) | |
| download | rust-1ebfe11730191e914dcf20297cdfdac5b7c297fc.tar.gz rust-1ebfe11730191e914dcf20297cdfdac5b7c297fc.zip | |
Add special `auto` value for `debug.sourceFileMap`
Diffstat (limited to 'editors/code/src/debug.ts')
| -rw-r--r-- | editors/code/src/debug.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/editors/code/src/debug.ts b/editors/code/src/debug.ts index fe8ec1be454..8c6969dc670 100644 --- a/editors/code/src/debug.ts +++ b/editors/code/src/debug.ts @@ -3,7 +3,7 @@ import * as vscode from 'vscode'; import * as path from 'path'; import * as ra from './lsp_ext'; -import { Cargo, sysrootForDir as getSysroot } from './toolchain'; +import { Cargo, getSysroot } from './toolchain'; import { Ctx } from "./ctx"; import { prepareEnv } from "./run"; @@ -105,11 +105,11 @@ async function getDebugConfiguration(ctx: Ctx, runnable: ra.Runnable): Promise<v const executable = await getDebugExecutable(runnable); const env = prepareEnv(runnable, ctx.config.runnableEnv); let sourceFileMap = debugOptions.sourceFileMap; - if ( !sourceFileMap || Object.keys(sourceFileMap).length === 0 ) { + if (sourceFileMap === "auto") { // let's try to use the default toolchain const sysroot = await getSysroot(wsFolder); - const rustlib_src = path.normalize(sysroot + "/lib/rustlib/src/rust"); - sourceFileMap = { "/rustc/*": rustlib_src }; + const rustlib = path.normalize(sysroot + "/lib/rustlib/src/rust"); + sourceFileMap = { "/rustc/*": rustlib }; } const debugConfig = knownEngines[debugEngine.id](runnable, simplifyPath(executable), env, sourceFileMap); |
