Skip to content

Commit eedba7d

Browse files
committed
Use 'Tool' instead of 'string'
1 parent ea0bf01 commit eedba7d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/hlsBinaries.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -324,15 +324,15 @@ export async function findHaskellLanguageServer(
324324
if (promptBeforeDownloads) {
325325
const hlsInstalled = latestHLS
326326
? await toolInstalled(context, logger, 'hls', latestHLS)
327-
: ([true, 'hls', ''] as [boolean, string, string]);
327+
: ([true, 'hls', ''] as [boolean, Tool, string]);
328328
const cabalInstalled = latestCabal
329329
? await toolInstalled(context, logger, 'cabal', latestCabal)
330-
: ([true, 'cabal', ''] as [boolean, string, string]);
330+
: ([true, 'cabal', ''] as [boolean, Tool, string]);
331331
const stackInstalled = latestStack
332332
? await toolInstalled(context, logger, 'stack', latestStack)
333-
: ([true, 'stack', ''] as [boolean, string, string]);
333+
: ([true, 'stack', ''] as [boolean, Tool, string]);
334334
const ghcInstalled = (await executableExists('ghc'))
335-
? ([true, 'ghc', ''] as [boolean, string, string])
335+
? ([true, 'ghc', ''] as [boolean, Tool, string])
336336
: await toolInstalled(context, logger, 'ghc', recGHC!);
337337
const toInstall = [hlsInstalled, cabalInstalled, stackInstalled, ghcInstalled]
338338
.filter(([b, t, v]) => !b)
@@ -400,10 +400,10 @@ export async function findHaskellLanguageServer(
400400
if (promptBeforeDownloads) {
401401
const hlsInstalled = projectHls
402402
? await toolInstalled(context, logger, 'hls', projectHls)
403-
: ([true, 'hls', ''] as [boolean, string, string]);
403+
: ([true, 'hls', ''] as [boolean, Tool, string]);
404404
const ghcInstalled = projectGhc
405405
? await toolInstalled(context, logger, 'ghc', projectGhc)
406-
: ([true, 'ghc', ''] as [boolean, string, string]);
406+
: ([true, 'ghc', ''] as [boolean, Tool, string]);
407407
const toInstall = [hlsInstalled, ghcInstalled].filter(([b, t, v]) => !b).map(([_, t, v]) => `${t}-${v}`);
408408
if (toInstall.length > 0) {
409409
const decision = await window.showInformationMessage(
@@ -678,7 +678,7 @@ export async function getStoragePath(context: ExtensionContext): Promise<string>
678678
}
679679

680680
// the tool might be installed or not
681-
async function getLatestToolFromGHCup(context: ExtensionContext, logger: Logger, tool: string): Promise<string> {
681+
async function getLatestToolFromGHCup(context: ExtensionContext, logger: Logger, tool: Tool): Promise<string> {
682682
// these might be custom/stray/compiled, so we try first
683683
const installedVersions = await callGHCup(
684684
context,
@@ -698,7 +698,7 @@ async function getLatestToolFromGHCup(context: ExtensionContext, logger: Logger,
698698
async function getLatestAvailableToolFromGHCup(
699699
context: ExtensionContext,
700700
logger: Logger,
701-
tool: string,
701+
tool: Tool,
702702
tag?: string,
703703
criteria?: string
704704
): Promise<string> {
@@ -772,9 +772,9 @@ async function getHLSesFromGHCup(context: ExtensionContext, logger: Logger): Pro
772772
async function toolInstalled(
773773
context: ExtensionContext,
774774
logger: Logger,
775-
tool: string,
775+
tool: Tool,
776776
version: string
777-
): Promise<[boolean, string, string]> {
777+
): Promise<[boolean, Tool, string]> {
778778
const b = await callGHCup(context, logger, ['whereis', tool, version], undefined, false)
779779
.then((x) => true)
780780
.catch((x) => false);

0 commit comments

Comments
 (0)