File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -118,8 +118,8 @@ async function getDebugConfiguration(
118118 return path . normalize ( p ) . replace ( wsFolder , "${workspaceFolder" + workspaceQualifier + "}" ) ;
119119 }
120120
121- const executable = await getDebugExecutable ( runnable ) ;
122121 const env = prepareEnv ( runnable , ctx . config . runnableEnv ) ;
122+ const executable = await getDebugExecutable ( runnable , env ) ;
123123 let sourceFileMap = debugOptions . sourceFileMap ;
124124 if ( sourceFileMap === "auto" ) {
125125 // let's try to use the default toolchain
@@ -156,8 +156,11 @@ async function getDebugConfiguration(
156156 return debugConfig ;
157157}
158158
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 ) ;
161164 const executable = await cargo . executableFromArgs ( runnable . args . cargoArgs ) ;
162165
163166 // 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 {
1818}
1919
2020export 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+ ) { }
2226
2327 // Made public for testing purposes
2428 static artifactSpec ( args : readonly string [ ] ) : ArtifactSpec {
@@ -102,6 +106,7 @@ export class Cargo {
102106 const cargo = cp . spawn ( path , cargoArgs , {
103107 stdio : [ "ignore" , "pipe" , "pipe" ] ,
104108 cwd : this . rootFolder ,
109+ env : this . env ,
105110 } ) ;
106111
107112 cargo . on ( "error" , ( err ) => reject ( new Error ( `could not launch cargo: ${ err } ` ) ) ) ;
You can’t perform that action at this time.
0 commit comments