@@ -28,8 +28,6 @@ import { tryStartDebugging } from './debugging/startDebugging';
2828import { WelcomeWebview } from './webviews/WelcomeWebview' ;
2929import { QuarkusConfig } from './QuarkusConfig' ;
3030
31- const disposables = [ ] ;
32- let terminateDebugListener : Disposable ;
3331let languageClient : LanguageClient ;
3432
3533interface QuarkusProjectInfoParams {
@@ -52,15 +50,15 @@ export function activate(context: ExtensionContext) {
5250 QuarkusContext . setContext ( context ) ;
5351 displayWelcomePageIfNeeded ( context ) ;
5452
55- terminateDebugListener = createTerminateDebugListener ( disposables ) ;
53+ context . subscriptions . push ( createTerminateDebugListener ( ) ) ;
5654
57- connectToLS ( ) . then ( ( ) => {
55+ connectToLS ( context ) . then ( ( ) => {
5856 const quarkusPojectInfoRequest = new RequestType < QuarkusProjectInfoParams , any , void , void > ( QuarkusLS . PROJECT_REQUEST ) ;
5957 languageClient . onRequest ( quarkusPojectInfoRequest , async ( params : QuarkusProjectInfoParams ) =>
6058 < any > await commands . executeCommand ( "java.execute.workspaceCommand" , JdtLSCommands . PROJECT_INFO_COMMAND , params )
6159 ) ;
6260
63- const quarkusPropertyDefinitionRequest = new RequestType < QuarkusPropertyDefinitionParams , any , void , void > ( QuarkusLS . PROPERTY_DEFINITION_REQUEST ) ;
61+ const quarkusPropertyDefinitionRequest = new RequestType < QuarkusPropertyDefinitionParams , any , void , void > ( QuarkusLS . PROPERTY_DEFINITION_REQUEST ) ;
6462 languageClient . onRequest ( quarkusPropertyDefinitionRequest , async ( params : QuarkusPropertyDefinitionParams ) =>
6563 < any > await commands . executeCommand ( "java.execute.workspaceCommand" , JdtLSCommands . PROPERTY_DEFINITION_COMMAND , params )
6664 ) ;
@@ -84,8 +82,6 @@ export function activate(context: ExtensionContext) {
8482}
8583
8684export function deactivate ( ) {
87- terminateDebugListener . dispose ( ) ;
88- disposables . forEach ( disposable => disposable . dispose ( ) ) ;
8985}
9086
9187function displayWelcomePageIfNeeded ( context : ExtensionContext ) : void {
@@ -125,7 +121,7 @@ function registerVSCodeCommands(context: ExtensionContext) {
125121 } ) ) ;
126122}
127123
128- function connectToLS ( ) {
124+ function connectToLS ( context : ExtensionContext ) {
129125 return requirements . resolveRequirements ( ) . then ( requirements => {
130126 const clientOptions : LanguageClientOptions = {
131127 documentSelector : [
@@ -150,7 +146,7 @@ function connectToLS() {
150146
151147 const serverOptions = prepareExecutable ( requirements ) ;
152148 languageClient = new LanguageClient ( 'quarkus.tools' , 'Quarkus Tools' , serverOptions , clientOptions ) ;
153- disposables . push ( languageClient . start ( ) ) ;
149+ context . subscriptions . push ( languageClient . start ( ) ) ;
154150 return languageClient . onReady ( ) ;
155151 } ) ;
156152
0 commit comments