@@ -190,39 +190,39 @@ export function activate(context: ExtensionContext): Promise<ExtensionAPI> {
190
190
return commands . executeCommand ( params . command , ...params . arguments ) ;
191
191
} ) ;
192
192
193
- commands . registerCommand ( Commands . OPEN_OUTPUT , ( ) => {
193
+ context . subscriptions . push ( commands . registerCommand ( Commands . OPEN_OUTPUT , ( ) => {
194
194
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 [ ] ) => {
197
197
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 [ ] ) => {
200
200
commands . executeCommand ( Commands . SHOW_REFERENCES , Uri . parse ( uri ) , languageClient . protocol2CodeConverter . asPosition ( position ) , locations . map ( languageClient . protocol2CodeConverter . asLocation ) ) ;
201
- } ) ;
201
+ } ) ) ;
202
202
203
- commands . registerCommand ( Commands . CONFIGURATION_UPDATE , uri => projectConfigurationUpdate ( languageClient , uri ) ) ;
203
+ context . subscriptions . push ( commands . registerCommand ( Commands . CONFIGURATION_UPDATE , uri => projectConfigurationUpdate ( languageClient , uri ) ) ) ;
204
204
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' ) ) ) ;
206
206
207
- commands . registerCommand ( Commands . IGNORE_INCOMPLETE_CLASSPATH_HELP , ( data ?: any ) => {
207
+ context . subscriptions . push ( commands . registerCommand ( Commands . IGNORE_INCOMPLETE_CLASSPATH_HELP , ( data ?: any ) => {
208
208
commands . executeCommand ( Commands . OPEN_BROWSER , Uri . parse ( 'https://github.com/redhat-developer/vscode-java/wiki/%22Classpath-is-incomplete%22-warning' ) ) ;
209
- } ) ;
209
+ } ) ) ;
210
210
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 ) ) ) ;
212
212
213
- commands . registerCommand ( Commands . APPLY_WORKSPACE_EDIT , ( obj ) => {
213
+ context . subscriptions . push ( commands . registerCommand ( Commands . APPLY_WORKSPACE_EDIT , ( obj ) => {
214
214
applyWorkspaceEdit ( obj , languageClient ) ;
215
- } ) ;
215
+ } ) ) ;
216
216
217
- commands . registerCommand ( Commands . EXECUTE_WORKSPACE_COMMAND , ( command , ...rest ) => {
217
+ context . subscriptions . push ( commands . registerCommand ( Commands . EXECUTE_WORKSPACE_COMMAND , ( command , ...rest ) => {
218
218
const params : ExecuteCommandParams = {
219
219
command,
220
220
arguments : rest
221
221
} ;
222
222
return languageClient . sendRequest ( ExecuteCommandRequest . type , params ) ;
223
- } ) ;
223
+ } ) ) ;
224
224
225
- commands . registerCommand ( Commands . COMPILE_WORKSPACE , ( isFullCompile : boolean ) => {
225
+ context . subscriptions . push ( commands . registerCommand ( Commands . COMPILE_WORKSPACE , ( isFullCompile : boolean ) => {
226
226
return window . withProgress ( { location : ProgressLocation . Window } , async p => {
227
227
if ( typeof isFullCompile !== 'boolean' ) {
228
228
const selection = await window . showQuickPick ( [ 'Incremental' , 'Full' ] , { 'placeHolder' : 'please choose compile type:' } ) ;
@@ -243,9 +243,9 @@ export function activate(context: ExtensionContext): Promise<ExtensionAPI> {
243
243
} , humanVisibleDelay ) ;
244
244
} ) ;
245
245
} ) ;
246
- } ) ;
246
+ } ) ) ;
247
247
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 > => {
249
249
const resolveRequest : SourceAttachmentRequest = {
250
250
classFileUri : classFileUri . toString ( ) ,
251
251
} ;
@@ -286,14 +286,14 @@ export function activate(context: ExtensionContext): Promise<ExtensionAPI> {
286
286
jdtEventEmitter . fire ( classFileUri ) ;
287
287
return true ;
288
288
}
289
- } ) ;
289
+ } ) ) ;
290
290
291
- buildpath . registerCommands ( ) ;
292
- sourceAction . registerCommands ( languageClient ) ;
291
+ buildpath . registerCommands ( context ) ;
292
+ sourceAction . registerCommands ( languageClient , context ) ;
293
293
294
- window . onDidChangeActiveTextEditor ( ( editor ) => {
294
+ context . subscriptions . push ( window . onDidChangeActiveTextEditor ( ( editor ) => {
295
295
toggleItem ( editor , item ) ;
296
- } ) ;
296
+ } ) ) ;
297
297
298
298
let provider : TextDocumentContentProvider = < TextDocumentContentProvider > {
299
299
onDidChange : jdtEventEmitter . event ,
@@ -303,7 +303,7 @@ export function activate(context: ExtensionContext): Promise<ExtensionAPI> {
303
303
} ) ;
304
304
}
305
305
} ;
306
- workspace . registerTextDocumentContentProvider ( 'jdt' , provider ) ;
306
+ context . subscriptions . push ( workspace . registerTextDocumentContentProvider ( 'jdt' , provider ) ) ;
307
307
excludeProjectSettingsFiles ( ) ;
308
308
} ) ;
309
309
@@ -318,12 +318,12 @@ export function activate(context: ExtensionContext): Promise<ExtensionAPI> {
318
318
319
319
languageClient . start ( ) ;
320
320
// 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 ) ) ) ;
322
322
323
323
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 ) ) ) ;
325
325
326
- commands . registerCommand ( Commands . CLEAN_WORKSPACE , ( ) => cleanWorkspace ( workspacePath ) ) ;
326
+ context . subscriptions . push ( commands . registerCommand ( Commands . CLEAN_WORKSPACE , ( ) => cleanWorkspace ( workspacePath ) ) ) ;
327
327
328
328
context . subscriptions . push ( onConfigurationChange ( ) ) ;
329
329
toggleItem ( window . activeTextEditor , item ) ;
0 commit comments