Skip to content

Commit

Permalink
Some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hasufell committed Mar 19, 2022
1 parent 09af1eb commit 21dc371
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/hlsBinaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ async function callAsync(
let newEnv: IEnvVars = await resolveServerEnvironmentPATH(workspace.getConfiguration('haskell').get('serverEnvironment') || {});
newEnv = {...process.env as IEnvVars, ...newEnv};
newEnv = {...newEnv, ...(envAdd || {})};
logger.info(`newEnv: ${newEnv.PATH!.split(':')}`);
return window.withProgress(
{
location: ProgressLocation.Notification,
Expand Down Expand Up @@ -255,7 +254,7 @@ export async function findHaskellLanguageServer(
? await getLatestToolFromGHCup(context, logger, 'stack')
: null;
const recGHC =
!executableExists('ghc') && (workspace.getConfiguration('haskell').get('installGHC') as boolean)
(!(await executableExists('ghc')) && (workspace.getConfiguration('haskell').get('installGHC') as boolean))
? await getLatestAvailableToolFromGHCup(context, logger, 'ghc', 'recommended')
: null;

Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,10 @@ export async function addPathToProcessPath(extraPath: string, logger: Logger): P

export async function resolveServerEnvironmentPATH(serverEnv: IEnvVars): Promise<IEnvVars> {
const pathSep = process.platform === 'win32' ? ';' : ':';
const path: string[] = serverEnv.PATH.split(pathSep).map((p) => resolvePATHPlaceHolders(p));
const path: string[] | null = serverEnv.PATH ? serverEnv.PATH.split(pathSep).map((p) => resolvePATHPlaceHolders(p)) : null;
return {
...serverEnv,
...{ PATH: path.join(pathSep)}
...(path ? { PATH: path.join(pathSep)} : {})
}
}

0 comments on commit 21dc371

Please sign in to comment.