Skip to content

Commit

Permalink
Merge pull request #599 from hasufell/issue-597
Browse files Browse the repository at this point in the history
Fix confusing download dialog popup
  • Loading branch information
fendor authored Apr 29, 2022
2 parents e81160d + 0c14e6b commit a910132
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/hlsBinaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,9 @@ export async function findHaskellLanguageServer(
: new InstalledTool('stack');
const ghcInstalled = (await executableExists('ghc'))
? new InstalledTool('ghc')
: await toolInstalled(context, logger, 'ghc', recGHC!);
// if recGHC is null, that means user disabled automatic handling,
// so we pretend it's installed in order to ignore it
: (recGHC !== null ? await toolInstalled(context, logger, 'ghc', recGHC) : new InstalledTool('ghc'));
const toInstall = [hlsInstalled, cabalInstalled, stackInstalled, ghcInstalled]
.filter((tool) => !tool.installed)
.map((tool) => tool.nameWithVersion);
Expand Down Expand Up @@ -903,7 +905,7 @@ class InstalledTool {
* @param version Version of the tool, expected to be either SemVer or PVP versioned.
* @param installed Is this tool currently installed?
*/
public constructor(readonly name: string, readonly version: string = '', readonly installed: boolean = true) {
public constructor(readonly name: string, readonly version?: string, readonly installed: boolean = true) {
this.nameWithVersion = `${name}-${version}`;
}
}

0 comments on commit a910132

Please sign in to comment.