This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export async function bootstrap(
2020
2121 log . info ( "Using server binary at" , path ) ;
2222
23- if ( ! isValidExecutable ( path ) ) {
23+ if ( ! isValidExecutable ( path , config . serverExtraEnv ) ) {
2424 if ( config . serverPath ) {
2525 throw new Error ( `Failed to execute ${ path } --version. \`config.server.path\` or \`config.serverPath\` has been set explicitly.\
2626 Consider removing this config or making a valid server binary available at that path.` ) ;
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import * as vscode from "vscode";
22import { strict as nativeAssert } from "assert" ;
33import { exec , type ExecOptions , spawnSync } from "child_process" ;
44import { inspect } from "util" ;
5+ import { Env } from "./client" ;
56
67export function assert ( condition : boolean , explanation : string ) : asserts condition {
78 try {
@@ -93,10 +94,13 @@ export function isDocumentInWorkspace(document: RustDocument): boolean {
9394 return false ;
9495}
9596
96- export function isValidExecutable ( path : string ) : boolean {
97+ export function isValidExecutable ( path : string , extraEnv : Env ) : boolean {
9798 log . debug ( "Checking availability of a binary at" , path ) ;
9899
99- const res = spawnSync ( path , [ "--version" ] , { encoding : "utf8" } ) ;
100+ const res = spawnSync ( path , [ "--version" ] , {
101+ encoding : "utf8" ,
102+ env : { ...process . env , ...extraEnv } ,
103+ } ) ;
100104
101105 const printOutput = res . error ? log . warn : log . info ;
102106 printOutput ( path , "--version:" , res ) ;
You can’t perform that action at this time.
0 commit comments