@@ -17,11 +17,13 @@ import {
17
17
InitializeParams ,
18
18
StreamInfo ,
19
19
createServerPipeTransport ,
20
+ Trace
20
21
} from "vscode-languageclient/node" ;
21
- import { Trace , createClientPipeTransport } from "vscode-jsonrpc/node" ;
22
22
import { createConnection } from "net" ;
23
23
24
- export function activate ( context : ExtensionContext ) {
24
+ let client : LanguageClient ;
25
+
26
+ export async function activate ( context : ExtensionContext ) {
25
27
// The server is implemented in node
26
28
let serverExe = "dotnet" ;
27
29
@@ -81,12 +83,12 @@ export function activate(context: ExtensionContext) {
81
83
} ;
82
84
83
85
// Create the language client and start the client.
84
- const client = new LanguageClient ( "languageServerExample" , "Language Server Example" , serverOptions , clientOptions ) ;
86
+ client = new LanguageClient ( "languageServerExample" , "Language Server Example" , serverOptions , clientOptions ) ;
85
87
client . registerProposedFeatures ( ) ;
86
- client . trace = Trace . Verbose ;
87
- let disposable = client . start ( ) ;
88
+ client . setTrace ( Trace . Verbose ) ;
89
+ await client . start ( ) ;
90
+ }
88
91
89
- // Push the disposable to the context's subscriptions so that the
90
- // client can be deactivated on extension deactivation
91
- context . subscriptions . push ( disposable ) ;
92
+ export function deactivate ( ) {
93
+ return client . stop ( ) ;
92
94
}
0 commit comments