@@ -23,7 +23,7 @@ import { CommandNames } from './commands/constants';
23
23
import { ImportIdentifier } from './commands/importIdentifier' ;
24
24
import { DocsBrowser } from './docsBrowser' ;
25
25
import { downloadHaskellLanguageServer } from './hlsBinaries' ;
26
- import { executableExists , ExtensionLogger , resolvePathPlaceHolders } from './utils' ;
26
+ import { directoryExists , executableExists , ExtensionLogger , resolvePathPlaceHolders } from './utils' ;
27
27
28
28
// The current map of documents & folders to language servers.
29
29
// It may be null to indicate that we are in the process of launching a server,
@@ -103,10 +103,16 @@ function findManualExecutable(logger: Logger, uri: Uri, folder?: WorkspaceFolder
103
103
}
104
104
logger . info ( `Trying to find the server executable in: ${ exePath } ` ) ;
105
105
exePath = resolvePathPlaceHolders ( exePath , folder ) ;
106
- logger . info ( `Location after path variables subsitution : ${ exePath } ` ) ;
106
+ logger . info ( `Location after path variables substitution : ${ exePath } ` ) ;
107
107
108
108
if ( ! executableExists ( exePath ) ) {
109
- throw new Error ( `serverExecutablePath is set to ${ exePath } but it doesn't exist and it is not on the PATH` ) ;
109
+ let msg = `serverExecutablePath is set to ${ exePath } ` ;
110
+ if ( directoryExists ( exePath ) ) {
111
+ msg += ' but it is a directory and the config option should point to the executable *full* path' ;
112
+ } else {
113
+ msg += " but it doesn't exist and it is not on the PATH" ;
114
+ }
115
+ throw new Error ( msg ) ;
110
116
}
111
117
return exePath ;
112
118
}
0 commit comments