@@ -190,39 +190,39 @@ export function activate(context: ExtensionContext): Promise<ExtensionAPI> {
190190 return commands . executeCommand ( params . command , ...params . arguments ) ;
191191 } ) ;
192192
193- commands . registerCommand ( Commands . OPEN_OUTPUT , ( ) => {
193+ context . subscriptions . push ( commands . registerCommand ( Commands . OPEN_OUTPUT , ( ) => {
194194 languageClient . outputChannel . show ( ViewColumn . Three ) ;
195- } ) ;
196- commands . registerCommand ( Commands . SHOW_JAVA_REFERENCES , ( uri : string , position : LSPosition , locations : LSLocation [ ] ) => {
195+ } ) ) ;
196+ context . subscriptions . push ( commands . registerCommand ( Commands . SHOW_JAVA_REFERENCES , ( uri : string , position : LSPosition , locations : LSLocation [ ] ) => {
197197 commands . executeCommand ( Commands . SHOW_REFERENCES , Uri . parse ( uri ) , languageClient . protocol2CodeConverter . asPosition ( position ) , locations . map ( languageClient . protocol2CodeConverter . asLocation ) ) ;
198- } ) ;
199- commands . registerCommand ( Commands . SHOW_JAVA_IMPLEMENTATIONS , ( uri : string , position : LSPosition , locations : LSLocation [ ] ) => {
198+ } ) ) ;
199+ context . subscriptions . push ( commands . registerCommand ( Commands . SHOW_JAVA_IMPLEMENTATIONS , ( uri : string , position : LSPosition , locations : LSLocation [ ] ) => {
200200 commands . executeCommand ( Commands . SHOW_REFERENCES , Uri . parse ( uri ) , languageClient . protocol2CodeConverter . asPosition ( position ) , locations . map ( languageClient . protocol2CodeConverter . asLocation ) ) ;
201- } ) ;
201+ } ) ) ;
202202
203- commands . registerCommand ( Commands . CONFIGURATION_UPDATE , uri => projectConfigurationUpdate ( languageClient , uri ) ) ;
203+ context . subscriptions . push ( commands . registerCommand ( Commands . CONFIGURATION_UPDATE , uri => projectConfigurationUpdate ( languageClient , uri ) ) ) ;
204204
205- commands . registerCommand ( Commands . IGNORE_INCOMPLETE_CLASSPATH , ( data ?: any ) => setIncompleteClasspathSeverity ( 'ignore' ) ) ;
205+ context . subscriptions . push ( commands . registerCommand ( Commands . IGNORE_INCOMPLETE_CLASSPATH , ( data ?: any ) => setIncompleteClasspathSeverity ( 'ignore' ) ) ) ;
206206
207- commands . registerCommand ( Commands . IGNORE_INCOMPLETE_CLASSPATH_HELP , ( data ?: any ) => {
207+ context . subscriptions . push ( commands . registerCommand ( Commands . IGNORE_INCOMPLETE_CLASSPATH_HELP , ( data ?: any ) => {
208208 commands . executeCommand ( Commands . OPEN_BROWSER , Uri . parse ( 'https://github.com/redhat-developer/vscode-java/wiki/%22Classpath-is-incomplete%22-warning' ) ) ;
209- } ) ;
209+ } ) ) ;
210210
211- commands . registerCommand ( Commands . PROJECT_CONFIGURATION_STATUS , ( uri , status ) => setProjectConfigurationUpdate ( languageClient , uri , status ) ) ;
211+ context . subscriptions . push ( commands . registerCommand ( Commands . PROJECT_CONFIGURATION_STATUS , ( uri , status ) => setProjectConfigurationUpdate ( languageClient , uri , status ) ) ) ;
212212
213- commands . registerCommand ( Commands . APPLY_WORKSPACE_EDIT , ( obj ) => {
213+ context . subscriptions . push ( commands . registerCommand ( Commands . APPLY_WORKSPACE_EDIT , ( obj ) => {
214214 applyWorkspaceEdit ( obj , languageClient ) ;
215- } ) ;
215+ } ) ) ;
216216
217- commands . registerCommand ( Commands . EXECUTE_WORKSPACE_COMMAND , ( command , ...rest ) => {
217+ context . subscriptions . push ( commands . registerCommand ( Commands . EXECUTE_WORKSPACE_COMMAND , ( command , ...rest ) => {
218218 const params : ExecuteCommandParams = {
219219 command,
220220 arguments : rest
221221 } ;
222222 return languageClient . sendRequest ( ExecuteCommandRequest . type , params ) ;
223- } ) ;
223+ } ) ) ;
224224
225- commands . registerCommand ( Commands . COMPILE_WORKSPACE , ( isFullCompile : boolean ) => {
225+ context . subscriptions . push ( commands . registerCommand ( Commands . COMPILE_WORKSPACE , ( isFullCompile : boolean ) => {
226226 return window . withProgress ( { location : ProgressLocation . Window } , async p => {
227227 if ( typeof isFullCompile !== 'boolean' ) {
228228 const selection = await window . showQuickPick ( [ 'Incremental' , 'Full' ] , { 'placeHolder' : 'please choose compile type:' } ) ;
@@ -243,9 +243,9 @@ export function activate(context: ExtensionContext): Promise<ExtensionAPI> {
243243 } , humanVisibleDelay ) ;
244244 } ) ;
245245 } ) ;
246- } ) ;
246+ } ) ) ;
247247
248- commands . registerCommand ( Commands . UPDATE_SOURCE_ATTACHMENT , async ( classFileUri : Uri ) : Promise < boolean > => {
248+ context . subscriptions . push ( commands . registerCommand ( Commands . UPDATE_SOURCE_ATTACHMENT , async ( classFileUri : Uri ) : Promise < boolean > => {
249249 const resolveRequest : SourceAttachmentRequest = {
250250 classFileUri : classFileUri . toString ( ) ,
251251 } ;
@@ -286,14 +286,14 @@ export function activate(context: ExtensionContext): Promise<ExtensionAPI> {
286286 jdtEventEmitter . fire ( classFileUri ) ;
287287 return true ;
288288 }
289- } ) ;
289+ } ) ) ;
290290
291- buildpath . registerCommands ( ) ;
292- sourceAction . registerCommands ( languageClient ) ;
291+ buildpath . registerCommands ( context ) ;
292+ sourceAction . registerCommands ( languageClient , context ) ;
293293
294- window . onDidChangeActiveTextEditor ( ( editor ) => {
294+ context . subscriptions . push ( window . onDidChangeActiveTextEditor ( ( editor ) => {
295295 toggleItem ( editor , item ) ;
296- } ) ;
296+ } ) ) ;
297297
298298 let provider : TextDocumentContentProvider = < TextDocumentContentProvider > {
299299 onDidChange : jdtEventEmitter . event ,
@@ -303,7 +303,7 @@ export function activate(context: ExtensionContext): Promise<ExtensionAPI> {
303303 } ) ;
304304 }
305305 } ;
306- workspace . registerTextDocumentContentProvider ( 'jdt' , provider ) ;
306+ context . subscriptions . push ( workspace . registerTextDocumentContentProvider ( 'jdt' , provider ) ) ;
307307 excludeProjectSettingsFiles ( ) ;
308308 } ) ;
309309
@@ -318,12 +318,12 @@ export function activate(context: ExtensionContext): Promise<ExtensionAPI> {
318318
319319 languageClient . start ( ) ;
320320 // Register commands here to make it available even when the language client fails
321- commands . registerCommand ( Commands . OPEN_SERVER_LOG , ( ) => openServerLogFile ( workspacePath ) ) ;
321+ context . subscriptions . push ( commands . registerCommand ( Commands . OPEN_SERVER_LOG , ( ) => openServerLogFile ( workspacePath ) ) ) ;
322322
323323 let extensionPath = context . extensionPath ;
324- commands . registerCommand ( Commands . OPEN_FORMATTER , async ( ) => openFormatter ( extensionPath ) ) ;
324+ context . subscriptions . push ( commands . registerCommand ( Commands . OPEN_FORMATTER , async ( ) => openFormatter ( extensionPath ) ) ) ;
325325
326- commands . registerCommand ( Commands . CLEAN_WORKSPACE , ( ) => cleanWorkspace ( workspacePath ) ) ;
326+ context . subscriptions . push ( commands . registerCommand ( Commands . CLEAN_WORKSPACE , ( ) => cleanWorkspace ( workspacePath ) ) ) ;
327327
328328 context . subscriptions . push ( onConfigurationChange ( ) ) ;
329329 toggleItem ( window . activeTextEditor , item ) ;
0 commit comments