File tree Expand file tree Collapse file tree 4 files changed +20
-0
lines changed
Expand file tree Collapse file tree 4 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -86,4 +86,10 @@ export class BspProxy {
8686 // TODO: Implement more specific error handling logic here
8787 } ) ;
8888 }
89+
90+ public closeConnection ( ) : void {
91+ this . buildServerConnector . close ( ) ;
92+ this . jdtlsImporterConnector . close ( ) ;
93+ this . logger . info ( "Build Server connection closed" ) ;
94+ }
8995}
Original file line number Diff line number Diff line change @@ -34,4 +34,10 @@ export class BuildServerConnector {
3434 public getServerPipePath ( ) : string {
3535 return this . serverPipePath ;
3636 }
37+
38+ public close ( ) : void {
39+ this . serverConnection ?. end ( ) ;
40+ this . serverConnection ?. dispose ( ) ;
41+ this . serverPipeServer . close ( ) ;
42+ }
3743}
Original file line number Diff line number Diff line change @@ -68,4 +68,10 @@ export class JdtlsImporterConnector {
6868 public getImporterConnection ( ) : rpc . MessageConnection | null {
6969 return this . importerConnection ;
7070 }
71+
72+ public close ( ) : void {
73+ this . importerConnection ?. end ( ) ;
74+ this . importerConnection ?. dispose ( ) ;
75+ this . importerPipeServer . close ( ) ;
76+ }
7177}
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ export class GradleServer {
8888 this . _onDidStop . fire ( null ) ;
8989 this . ready = false ;
9090 this . process ?. removeAllListeners ( ) ;
91+ this . bspProxy . closeConnection ( ) ;
9192 if ( this . restarting ) {
9293 this . restarting = false ;
9394 await this . start ( ) ;
@@ -163,6 +164,7 @@ export class GradleServer {
163164 }
164165
165166 public async asyncDispose ( ) : Promise < void > {
167+ this . bspProxy . closeConnection ( ) ;
166168 this . process ?. removeAllListeners ( ) ;
167169 await this . killProcess ( ) ;
168170 this . ready = false ;
You can’t perform that action at this time.
0 commit comments