@@ -49,7 +49,7 @@ export async function activate(context: ExtensionContext) {
49
49
const uri = folder . uri . toString ( ) ;
50
50
client . info ( `Deleting folder for clients: ${ uri } ` ) ;
51
51
clients . delete ( uri ) ;
52
- client . info ( 'Stopping the client ' ) ;
52
+ client . info ( 'Stopping the server ' ) ;
53
53
client . stop ( ) ;
54
54
}
55
55
}
@@ -58,9 +58,9 @@ export async function activate(context: ExtensionContext) {
58
58
// Register editor commands for HIE, but only register the commands once at activation.
59
59
const restartCmd = commands . registerCommand ( CommandNames . RestartServerCommandName , async ( ) => {
60
60
for ( const langClient of clients . values ( ) ) {
61
- langClient ?. info ( 'Stopping the client ' ) ;
61
+ langClient ?. info ( 'Stopping the server ' ) ;
62
62
await langClient ?. stop ( ) ;
63
- langClient ?. info ( 'Starting the client ' ) ;
63
+ langClient ?. info ( 'Starting the server ' ) ;
64
64
langClient ?. start ( ) ;
65
65
}
66
66
} ) ;
@@ -69,19 +69,19 @@ export async function activate(context: ExtensionContext) {
69
69
70
70
const stopCmd = commands . registerCommand ( CommandNames . StopServerCommandName , async ( ) => {
71
71
for ( const langClient of clients . values ( ) ) {
72
- langClient ?. info ( 'Stopping the client ' ) ;
72
+ langClient ?. info ( 'Stopping the server ' ) ;
73
73
await langClient ?. stop ( ) ;
74
- langClient ?. info ( 'Client stopped' ) ;
74
+ langClient ?. info ( 'Server stopped' ) ;
75
75
}
76
76
} ) ;
77
77
78
78
context . subscriptions . push ( stopCmd ) ;
79
79
80
80
const startCmd = commands . registerCommand ( CommandNames . StartServerCommandName , async ( ) => {
81
81
for ( const langClient of clients . values ( ) ) {
82
- langClient ?. info ( 'Starting the client ' ) ;
82
+ langClient ?. info ( 'Starting the server ' ) ;
83
83
langClient ?. start ( ) ;
84
- langClient ?. info ( 'Client started' ) ;
84
+ langClient ?. info ( 'Server started' ) ;
85
85
}
86
86
} ) ;
87
87
@@ -118,10 +118,10 @@ function findManualExecutable(logger: Logger, uri: Uri, folder?: WorkspaceFolder
118
118
/** Searches the PATH for whatever is set in serverVariant */
119
119
function findLocalServer ( context : ExtensionContext , logger : Logger , uri : Uri , folder ?: WorkspaceFolder ) : string | null {
120
120
const exes : string [ ] = [ 'haskell-language-server-wrapper' , 'haskell-language-server' ] ;
121
- logger . info ( `Searching for server executables ${ exes . join ( ' ' ) } in PATH` ) ;
121
+ logger . info ( `Searching for server executables ${ exes . join ( ', ' ) } in $ PATH` ) ;
122
122
for ( const exe of exes ) {
123
123
if ( executableExists ( exe ) ) {
124
- logger . info ( `Found server executable in PATH: ${ exe } ` ) ;
124
+ logger . info ( `Found server executable in $ PATH: ${ exe } ` ) ;
125
125
return exe ;
126
126
}
127
127
}
@@ -178,7 +178,7 @@ async function activateServerForFolder(context: ExtensionContext, uri: Uri, fold
178
178
}
179
179
} catch ( e ) {
180
180
if ( e instanceof Error ) {
181
- logger . error ( ' Error getting the server executable: ${e.message}' ) ;
181
+ logger . error ( ` Error getting the server executable: ${ e . message } ` ) ;
182
182
window . showErrorMessage ( e . message ) ;
183
183
}
184
184
return ;
@@ -197,6 +197,12 @@ async function activateServerForFolder(context: ExtensionContext, uri: Uri, fold
197
197
// If we're operating on a standalone file (i.e. not in a folder) then we need
198
198
// to launch the server in a reasonable current directory. Otherwise the cradle
199
199
// guessing logic in hie-bios will be wrong!
200
+ if ( folder ) {
201
+ logger . info ( `Activating the language server in the workspace folder: ${ folder ?. uri . fsPath } ` ) ;
202
+ } else {
203
+ logger . info ( `Activating the language server in the parent dir of the file: ${ uri . fsPath } ` ) ;
204
+ }
205
+
200
206
const exeOptions : ExecutableOptions = {
201
207
cwd : folder ? undefined : path . dirname ( uri . fsPath ) ,
202
208
} ;
@@ -210,9 +216,12 @@ async function activateServerForFolder(context: ExtensionContext, uri: Uri, fold
210
216
211
217
logger . info ( `run command: ${ serverExecutable } ${ args . join ( ' ' ) } ` ) ;
212
218
logger . info ( `debug command: ${ serverExecutable } ${ args . join ( ' ' ) } ` ) ;
213
- logger . info ( `server cwd: ${ exeOptions . cwd } ` ) ;
219
+ if ( exeOptions . cwd ) {
220
+ logger . info ( `server cwd: ${ exeOptions . cwd } ` ) ;
221
+ }
214
222
215
223
const pat = folder ? `${ folder . uri . fsPath } /**/*` : '**/*' ;
224
+ logger . info ( `document selector patten: ${ pat } ` ) ;
216
225
const clientOptions : LanguageClientOptions = {
217
226
// Use the document selector to only notify the LSP on files inside the folder
218
227
// path for the specific workspace.
@@ -244,7 +253,7 @@ async function activateServerForFolder(context: ExtensionContext, uri: Uri, fold
244
253
langClient . registerProposedFeatures ( ) ;
245
254
246
255
// Finally start the client and add it to the list of clients.
247
- logger . info ( 'Starting language client ' ) ;
256
+ logger . info ( 'Starting language server ' ) ;
248
257
langClient . start ( ) ;
249
258
clients . set ( clientsKey , langClient ) ;
250
259
}
0 commit comments