File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,25 @@ async function createLanguageClient (
125125 return undefined
126126 }
127127
128- const client = new MonacoLanguageClient ( {
128+ // Hack to force close the connection when the language client stops
129+ // Even if the `shutdown` request failed
130+ class _MonacoLanguageClient extends MonacoLanguageClient {
131+ override async stop ( timeout : number ) : Promise < void > {
132+ // eslint-disable-next-line dot-notation
133+ const connection = this [ '_connection' ]
134+ try {
135+ await super . stop ( timeout )
136+ } finally {
137+ try {
138+ connection . dispose ( )
139+ } catch ( err ) {
140+ // ignore
141+ }
142+ }
143+ }
144+ }
145+
146+ const client = new _MonacoLanguageClient ( {
129147 id : `${ id } -languageclient` ,
130148 name : `CodinGame ${ id } Language Client` ,
131149 clientOptions : {
You can’t perform that action at this time.
0 commit comments