File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 1+
2+ import { TestInfrastructure } from './tools'
3+ import { createLanguageClientManager , getLanguageClientOptions } from '..'
4+
5+ describe ( 'Lifecycle' , ( ) => {
6+ test ( 'Can dispose the language client manager immediately' , async ( ) => {
7+ const infrastructure = new TestInfrastructure ( false , false , 2000 )
8+
9+ const languageClient = createLanguageClientManager ( 'java' , infrastructure , {
10+ ...getLanguageClientOptions ( 'java' ) ,
11+ createAdditionalFeatures : undefined
12+ } )
13+ const startPromise = languageClient . start ( )
14+ await languageClient . dispose ( )
15+ await startPromise
16+ } )
17+ } )
Original file line number Diff line number Diff line change @@ -116,7 +116,8 @@ export class TestInfrastructure implements Infrastructure {
116116
117117 constructor (
118118 public automaticTextDocumentUpdate : boolean ,
119- public _useMutualizedProxy : boolean
119+ public _useMutualizedProxy : boolean ,
120+ public connectionCreationDelay : number = 0
120121 ) { }
121122
122123 useMutualizedProxy ( languageClientId : LanguageClientId , options : LanguageClientOptions ) : boolean {
@@ -160,6 +161,7 @@ export class TestInfrastructure implements Infrastructure {
160161 exit : function ( ) : void { }
161162 }
162163 const clientConnection = createConnection ( ( ) => c2 , watchDog )
164+ await new Promise ( resolve => setTimeout ( resolve , this . connectionCreationDelay ) )
163165 this . connectionDeferred . resolve ( clientConnection )
164166 c2 . listen ( )
165167
You can’t perform that action at this time.
0 commit comments