@@ -17,11 +17,13 @@ import {
1717 InitializeParams ,
1818 StreamInfo ,
1919 createServerPipeTransport ,
20+ Trace
2021} from "vscode-languageclient/node" ;
21- import { Trace , createClientPipeTransport } from "vscode-jsonrpc/node" ;
2222import { createConnection } from "net" ;
2323
24- export function activate ( context : ExtensionContext ) {
24+ let client : LanguageClient ;
25+
26+ export async function activate ( context : ExtensionContext ) {
2527 // The server is implemented in node
2628 let serverExe = "dotnet" ;
2729
@@ -81,12 +83,12 @@ export function activate(context: ExtensionContext) {
8183 } ;
8284
8385 // 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 ) ;
8587 client . registerProposedFeatures ( ) ;
86- client . trace = Trace . Verbose ;
87- let disposable = client . start ( ) ;
88+ client . setTrace ( Trace . Verbose ) ;
89+ await client . start ( ) ;
90+ }
8891
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 ( ) ;
9294}
0 commit comments