File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
packages/tailwindcss-language-server/tests/utils Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,15 @@ import {
12
12
DocumentLinkRequest ,
13
13
DocumentSymbol ,
14
14
DocumentSymbolRequest ,
15
+ ExitNotification ,
15
16
FileChangeType ,
16
17
FileEvent ,
17
18
Hover ,
18
19
NotificationHandler ,
19
20
ProtocolConnection ,
20
21
PublishDiagnosticsParams ,
21
22
Registration ,
23
+ ShutdownRequest ,
22
24
SymbolInformation ,
23
25
UnregistrationRequest ,
24
26
WorkspaceFolder ,
@@ -226,6 +228,11 @@ export interface Client extends ClientWorkspace {
226
228
* Update the global settings for the server
227
229
*/
228
230
updateSettings ( settings : DeepPartial < Settings > ) : Promise < void >
231
+
232
+ /**
233
+ * Shutdown the server
234
+ */
235
+ shutdown ( ) : Promise < void >
229
236
}
230
237
231
238
export interface ClientWorkspaceOptions {
@@ -567,6 +574,13 @@ export async function createClient(opts: ClientOptions): Promise<Client> {
567
574
} )
568
575
}
569
576
577
+ let didExit = new Promise < void > ( ( resolve ) => conn . onNotification ( ExitNotification . type , resolve ) )
578
+
579
+ async function shutdown ( ) {
580
+ await conn . sendRequest ( ShutdownRequest . type )
581
+ await didExit
582
+ }
583
+
570
584
return {
571
585
...clientWorkspaces [ 0 ] ,
572
586
get serverCapabilities ( ) {
@@ -576,6 +590,7 @@ export async function createClient(opts: ClientOptions): Promise<Client> {
576
590
notifyChangedFiles,
577
591
workspace,
578
592
updateSettings,
593
+ shutdown,
579
594
}
580
595
}
581
596
You can’t perform that action at this time.
0 commit comments