Skip to content

Commit a910132

Browse files
authored
Merge pull request #599 from hasufell/issue-597
Fix confusing download dialog popup
2 parents e81160d + 0c14e6b commit a910132

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/hlsBinaries.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,9 @@ export async function findHaskellLanguageServer(
286286
: new InstalledTool('stack');
287287
const ghcInstalled = (await executableExists('ghc'))
288288
? new InstalledTool('ghc')
289-
: await toolInstalled(context, logger, 'ghc', recGHC!);
289+
// if recGHC is null, that means user disabled automatic handling,
290+
// so we pretend it's installed in order to ignore it
291+
: (recGHC !== null ? await toolInstalled(context, logger, 'ghc', recGHC) : new InstalledTool('ghc'));
290292
const toInstall = [hlsInstalled, cabalInstalled, stackInstalled, ghcInstalled]
291293
.filter((tool) => !tool.installed)
292294
.map((tool) => tool.nameWithVersion);
@@ -903,7 +905,7 @@ class InstalledTool {
903905
* @param version Version of the tool, expected to be either SemVer or PVP versioned.
904906
* @param installed Is this tool currently installed?
905907
*/
906-
public constructor(readonly name: string, readonly version: string = '', readonly installed: boolean = true) {
908+
public constructor(readonly name: string, readonly version?: string, readonly installed: boolean = true) {
907909
this.nameWithVersion = `${name}-${version}`;
908910
}
909911
}

0 commit comments

Comments
 (0)