File tree 2 files changed +12
-4
lines changed
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -118,8 +118,8 @@ async function getDebugConfiguration(
118
118
return path . normalize ( p ) . replace ( wsFolder , "${workspaceFolder" + workspaceQualifier + "}" ) ;
119
119
}
120
120
121
- const executable = await getDebugExecutable ( runnable ) ;
122
121
const env = prepareEnv ( runnable , ctx . config . runnableEnv ) ;
122
+ const executable = await getDebugExecutable ( runnable , env ) ;
123
123
let sourceFileMap = debugOptions . sourceFileMap ;
124
124
if ( sourceFileMap === "auto" ) {
125
125
// let's try to use the default toolchain
@@ -156,8 +156,11 @@ async function getDebugConfiguration(
156
156
return debugConfig ;
157
157
}
158
158
159
- async function getDebugExecutable ( runnable : ra . Runnable ) : Promise < string > {
160
- const cargo = new Cargo ( runnable . args . workspaceRoot || "." , debugOutput ) ;
159
+ async function getDebugExecutable (
160
+ runnable : ra . Runnable ,
161
+ env : Record < string , string >
162
+ ) : Promise < string > {
163
+ const cargo = new Cargo ( runnable . args . workspaceRoot || "." , debugOutput , env ) ;
161
164
const executable = await cargo . executableFromArgs ( runnable . args . cargoArgs ) ;
162
165
163
166
// if we are here, there were no compilation errors.
Original file line number Diff line number Diff line change @@ -18,7 +18,11 @@ export interface ArtifactSpec {
18
18
}
19
19
20
20
export class Cargo {
21
- constructor ( readonly rootFolder : string , readonly output : vscode . OutputChannel ) { }
21
+ constructor (
22
+ readonly rootFolder : string ,
23
+ readonly output : vscode . OutputChannel ,
24
+ readonly env : Record < string , string >
25
+ ) { }
22
26
23
27
// Made public for testing purposes
24
28
static artifactSpec ( args : readonly string [ ] ) : ArtifactSpec {
@@ -102,6 +106,7 @@ export class Cargo {
102
106
const cargo = cp . spawn ( path , cargoArgs , {
103
107
stdio : [ "ignore" , "pipe" , "pipe" ] ,
104
108
cwd : this . rootFolder ,
109
+ env : this . env ,
105
110
} ) ;
106
111
107
112
cargo . on ( "error" , ( err ) => reject ( new Error ( `could not launch cargo: ${ err } ` ) ) ) ;
You can’t perform that action at this time.
0 commit comments