@@ -117,9 +117,9 @@ export default class AutoLanguageClient {
117
117
}
118
118
119
119
/** (Optional) Return the parameters used to initialize a client - you may want to extend capabilities */
120
- protected getInitializeParams ( projectPath : string , process : LanguageServerProcess ) : ls . InitializeParams {
120
+ protected getInitializeParams ( projectPath : string , lsProcess : LanguageServerProcess ) : ls . InitializeParams {
121
121
return {
122
- processId : process . pid ,
122
+ processId : lsProcess . pid ,
123
123
rootPath : projectPath ,
124
124
rootUri : Convert . pathToUri ( projectPath ) ,
125
125
workspaceFolders : null ,
@@ -312,14 +312,14 @@ export default class AutoLanguageClient {
312
312
313
313
/** Starts the server by starting the process, then initializing the language server and starting adapters */
314
314
private async startServer ( projectPath : string ) : Promise < ActiveServer > {
315
- const process = await this . reportBusyWhile (
315
+ const lsProcess = await this . reportBusyWhile (
316
316
`Starting ${ this . getServerName ( ) } for ${ path . basename ( projectPath ) } ` ,
317
317
async ( ) => this . startServerProcess ( projectPath ) ,
318
318
) ;
319
- this . captureServerErrors ( process , projectPath ) ;
320
- const connection = new LanguageClientConnection ( this . createRpcConnection ( process ) , this . logger ) ;
319
+ this . captureServerErrors ( lsProcess , projectPath ) ;
320
+ const connection = new LanguageClientConnection ( this . createRpcConnection ( lsProcess ) , this . logger ) ;
321
321
this . preInitialization ( connection ) ;
322
- const initializeParams = this . getInitializeParams ( projectPath , process ) ;
322
+ const initializeParams = this . getInitializeParams ( projectPath , lsProcess ) ;
323
323
const initialization = connection . initialize ( initializeParams ) ;
324
324
this . reportBusyWhile (
325
325
`${ this . getServerName ( ) } initializing for ${ path . basename ( projectPath ) } ` ,
@@ -328,7 +328,7 @@ export default class AutoLanguageClient {
328
328
const initializeResponse = await initialization ;
329
329
const newServer = {
330
330
projectPath,
331
- process,
331
+ process : lsProcess ,
332
332
connection,
333
333
capabilities : initializeResponse . capabilities ,
334
334
disposable : new CompositeDisposable ( ) ,
@@ -366,11 +366,11 @@ export default class AutoLanguageClient {
366
366
return newServer ;
367
367
}
368
368
369
- private captureServerErrors ( childProcess : LanguageServerProcess , projectPath : string ) : void {
370
- childProcess . on ( 'error' , ( err ) => this . handleSpawnFailure ( err ) ) ;
371
- childProcess . on ( 'exit' , ( code , signal ) => this . logger . debug ( `exit: code ${ code } signal ${ signal } ` ) ) ;
372
- childProcess . stderr . setEncoding ( 'utf8' ) ;
373
- childProcess . stderr . on ( 'data' , ( chunk : Buffer ) => {
369
+ private captureServerErrors ( lsProcess : LanguageServerProcess , projectPath : string ) : void {
370
+ lsProcess . on ( 'error' , ( err ) => this . handleSpawnFailure ( err ) ) ;
371
+ lsProcess . on ( 'exit' , ( code , signal ) => this . logger . debug ( `exit: code ${ code } signal ${ signal } ` ) ) ;
372
+ lsProcess . stderr . setEncoding ( 'utf8' ) ;
373
+ lsProcess . stderr . on ( 'data' , ( chunk : Buffer ) => {
374
374
const errorString = chunk . toString ( ) ;
375
375
this . handleServerStderr ( errorString , projectPath ) ;
376
376
// Keep the last 5 lines for packages to use in messages
@@ -392,22 +392,22 @@ export default class AutoLanguageClient {
392
392
}
393
393
394
394
/** Creates the RPC connection which can be ipc, socket or stdio */
395
- private createRpcConnection ( process : LanguageServerProcess ) : rpc . MessageConnection {
395
+ private createRpcConnection ( lsProcess : LanguageServerProcess ) : rpc . MessageConnection {
396
396
let reader : rpc . MessageReader ;
397
397
let writer : rpc . MessageWriter ;
398
398
const connectionType = this . getConnectionType ( ) ;
399
399
switch ( connectionType ) {
400
400
case 'ipc' :
401
- reader = new rpc . IPCMessageReader ( process as cp . ChildProcess ) ;
402
- writer = new rpc . IPCMessageWriter ( process as cp . ChildProcess ) ;
401
+ reader = new rpc . IPCMessageReader ( lsProcess as cp . ChildProcess ) ;
402
+ writer = new rpc . IPCMessageWriter ( lsProcess as cp . ChildProcess ) ;
403
403
break ;
404
404
case 'socket' :
405
405
reader = new rpc . SocketMessageReader ( this . socket ) ;
406
406
writer = new rpc . SocketMessageWriter ( this . socket ) ;
407
407
break ;
408
408
case 'stdio' :
409
- reader = new rpc . StreamMessageReader ( process . stdout ) ;
410
- writer = new rpc . StreamMessageWriter ( process . stdin ) ;
409
+ reader = new rpc . StreamMessageReader ( lsProcess . stdout ) ;
410
+ writer = new rpc . StreamMessageWriter ( lsProcess . stdin ) ;
411
411
break ;
412
412
default :
413
413
return Utils . assertUnreachable ( connectionType ) ;
0 commit comments