@@ -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