@@ -324,15 +324,15 @@ export async function findHaskellLanguageServer(
324
324
if ( promptBeforeDownloads ) {
325
325
const hlsInstalled = latestHLS
326
326
? await toolInstalled ( context , logger , 'hls' , latestHLS )
327
- : ( [ true , 'hls' , '' ] as [ boolean , string , string ] ) ;
327
+ : ( [ true , 'hls' , '' ] as [ boolean , Tool , string ] ) ;
328
328
const cabalInstalled = latestCabal
329
329
? await toolInstalled ( context , logger , 'cabal' , latestCabal )
330
- : ( [ true , 'cabal' , '' ] as [ boolean , string , string ] ) ;
330
+ : ( [ true , 'cabal' , '' ] as [ boolean , Tool , string ] ) ;
331
331
const stackInstalled = latestStack
332
332
? await toolInstalled ( context , logger , 'stack' , latestStack )
333
- : ( [ true , 'stack' , '' ] as [ boolean , string , string ] ) ;
333
+ : ( [ true , 'stack' , '' ] as [ boolean , Tool , string ] ) ;
334
334
const ghcInstalled = ( await executableExists ( 'ghc' ) )
335
- ? ( [ true , 'ghc' , '' ] as [ boolean , string , string ] )
335
+ ? ( [ true , 'ghc' , '' ] as [ boolean , Tool , string ] )
336
336
: await toolInstalled ( context , logger , 'ghc' , recGHC ! ) ;
337
337
const toInstall = [ hlsInstalled , cabalInstalled , stackInstalled , ghcInstalled ]
338
338
. filter ( ( [ b , t , v ] ) => ! b )
@@ -400,10 +400,10 @@ export async function findHaskellLanguageServer(
400
400
if ( promptBeforeDownloads ) {
401
401
const hlsInstalled = projectHls
402
402
? await toolInstalled ( context , logger , 'hls' , projectHls )
403
- : ( [ true , 'hls' , '' ] as [ boolean , string , string ] ) ;
403
+ : ( [ true , 'hls' , '' ] as [ boolean , Tool , string ] ) ;
404
404
const ghcInstalled = projectGhc
405
405
? await toolInstalled ( context , logger , 'ghc' , projectGhc )
406
- : ( [ true , 'ghc' , '' ] as [ boolean , string , string ] ) ;
406
+ : ( [ true , 'ghc' , '' ] as [ boolean , Tool , string ] ) ;
407
407
const toInstall = [ hlsInstalled , ghcInstalled ] . filter ( ( [ b , t , v ] ) => ! b ) . map ( ( [ _ , t , v ] ) => `${ t } -${ v } ` ) ;
408
408
if ( toInstall . length > 0 ) {
409
409
const decision = await window . showInformationMessage (
@@ -678,7 +678,7 @@ export async function getStoragePath(context: ExtensionContext): Promise<string>
678
678
}
679
679
680
680
// 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 > {
682
682
// these might be custom/stray/compiled, so we try first
683
683
const installedVersions = await callGHCup (
684
684
context ,
@@ -698,7 +698,7 @@ async function getLatestToolFromGHCup(context: ExtensionContext, logger: Logger,
698
698
async function getLatestAvailableToolFromGHCup (
699
699
context : ExtensionContext ,
700
700
logger : Logger ,
701
- tool : string ,
701
+ tool : Tool ,
702
702
tag ?: string ,
703
703
criteria ?: string
704
704
) : Promise < string > {
@@ -772,9 +772,9 @@ async function getHLSesFromGHCup(context: ExtensionContext, logger: Logger): Pro
772
772
async function toolInstalled (
773
773
context : ExtensionContext ,
774
774
logger : Logger ,
775
- tool : string ,
775
+ tool : Tool ,
776
776
version : string
777
- ) : Promise < [ boolean , string , string ] > {
777
+ ) : Promise < [ boolean , Tool , string ] > {
778
778
const b = await callGHCup ( context , logger , [ 'whereis' , tool , version ] , undefined , false )
779
779
. then ( ( x ) => true )
780
780
. catch ( ( x ) => false ) ;
0 commit comments