Skip to content

Commit 21dc371

Browse files
committed
Some fixes
1 parent 09af1eb commit 21dc371

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/hlsBinaries.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ async function callAsync(
102102
let newEnv: IEnvVars = await resolveServerEnvironmentPATH(workspace.getConfiguration('haskell').get('serverEnvironment') || {});
103103
newEnv = {...process.env as IEnvVars, ...newEnv};
104104
newEnv = {...newEnv, ...(envAdd || {})};
105-
logger.info(`newEnv: ${newEnv.PATH!.split(':')}`);
106105
return window.withProgress(
107106
{
108107
location: ProgressLocation.Notification,
@@ -255,7 +254,7 @@ export async function findHaskellLanguageServer(
255254
? await getLatestToolFromGHCup(context, logger, 'stack')
256255
: null;
257256
const recGHC =
258-
!executableExists('ghc') && (workspace.getConfiguration('haskell').get('installGHC') as boolean)
257+
(!(await executableExists('ghc')) && (workspace.getConfiguration('haskell').get('installGHC') as boolean))
259258
? await getLatestAvailableToolFromGHCup(context, logger, 'ghc', 'recommended')
260259
: null;
261260

src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,10 @@ export async function addPathToProcessPath(extraPath: string, logger: Logger): P
333333

334334
export async function resolveServerEnvironmentPATH(serverEnv: IEnvVars): Promise<IEnvVars> {
335335
const pathSep = process.platform === 'win32' ? ';' : ':';
336-
const path: string[] = serverEnv.PATH.split(pathSep).map((p) => resolvePATHPlaceHolders(p));
336+
const path: string[] | null = serverEnv.PATH ? serverEnv.PATH.split(pathSep).map((p) => resolvePATHPlaceHolders(p)) : null;
337337
return {
338338
...serverEnv,
339-
...{ PATH: path.join(pathSep)}
339+
...(path ? { PATH: path.join(pathSep)} : {})
340340
}
341341
}
342342

0 commit comments

Comments
 (0)