@@ -155,17 +155,18 @@ export interface StaticFeature {
155
155
getState ( ) : FeatureState ;
156
156
157
157
/**
158
- * Called when the client is stopped to dispose this feature. Usually a feature
159
- * un-registers listeners registered hooked up with the VS Code extension host.
158
+ * Called when the client is stopped or re-started to clear this feature.
159
+ * Usually a feature un-registers listeners registered hooked up with the
160
+ * VS Code extension host.
160
161
*/
161
- dispose ( ) : void ;
162
+ clear ( ) : void ;
162
163
}
163
164
164
165
export namespace StaticFeature {
165
166
export function is ( value : any ) : value is StaticFeature {
166
167
const candidate : StaticFeature = value ;
167
168
return candidate !== undefined && candidate !== null &&
168
- Is . func ( candidate . fillClientCapabilities ) && Is . func ( candidate . initialize ) && Is . func ( candidate . getState ) && Is . func ( candidate . dispose ) &&
169
+ Is . func ( candidate . fillClientCapabilities ) && Is . func ( candidate . initialize ) && Is . func ( candidate . getState ) && Is . func ( candidate . clear ) &&
169
170
( candidate . fillInitializeParams === undefined || Is . func ( candidate . fillInitializeParams ) ) ;
170
171
}
171
172
}
@@ -237,17 +238,18 @@ export interface DynamicFeature<RO> {
237
238
unregister ( id : string ) : void ;
238
239
239
240
/**
240
- * Called when the client is stopped to dispose this feature. Usually a feature
241
- * un-registers listeners registered hooked up with the VS Code extension host.
241
+ * Called when the client is stopped or re-started to clear this feature.
242
+ * Usually a feature un-registers listeners registered hooked up with the
243
+ * VS Code extension host.
242
244
*/
243
- dispose ( ) : void ;
245
+ clear ( ) : void ;
244
246
}
245
247
246
248
export namespace DynamicFeature {
247
249
export function is < T > ( value : any ) : value is DynamicFeature < T > {
248
250
const candidate : DynamicFeature < T > = value ;
249
251
return candidate !== undefined && candidate !== null &&
250
- Is . func ( candidate . fillClientCapabilities ) && Is . func ( candidate . initialize ) && Is . func ( candidate . getState ) && Is . func ( candidate . dispose ) &&
252
+ Is . func ( candidate . fillClientCapabilities ) && Is . func ( candidate . initialize ) && Is . func ( candidate . getState ) && Is . func ( candidate . clear ) &&
251
253
( candidate . fillInitializeParams === undefined || Is . func ( candidate . fillInitializeParams ) ) && Is . func ( candidate . register ) &&
252
254
Is . func ( candidate . unregister ) && candidate . registrationType !== undefined ;
253
255
}
@@ -285,7 +287,7 @@ export abstract class DynamicDocumentFeature<RO, MW, CO = object> implements Dyn
285
287
public abstract registrationType : RegistrationType < RO > ;
286
288
public abstract register ( data : RegistrationData < RO > ) : void ;
287
289
public abstract unregister ( id : string ) : void ;
288
- public abstract dispose ( ) : void ;
290
+ public abstract clear ( ) : void ;
289
291
290
292
/**
291
293
* Returns the state the feature is in.
@@ -424,7 +426,7 @@ export abstract class TextDocumentEventFeature<P extends { textDocument: TextDoc
424
426
}
425
427
}
426
428
427
- public dispose ( ) : void {
429
+ public clear ( ) : void {
428
430
this . _selectors . clear ( ) ;
429
431
this . _onNotificationSent . dispose ( ) ;
430
432
if ( this . _listener ) {
@@ -518,7 +520,7 @@ export abstract class TextDocumentLanguageFeature<PO, RO extends TextDocumentReg
518
520
}
519
521
}
520
522
521
- public dispose ( ) : void {
523
+ public clear ( ) : void {
522
524
this . _registrations . forEach ( ( value ) => {
523
525
value . disposable . dispose ( ) ;
524
526
} ) ;
@@ -618,7 +620,7 @@ export abstract class WorkspaceFeature<RO, PR, M> implements DynamicFeature<RO>
618
620
}
619
621
}
620
622
621
- public dispose ( ) : void {
623
+ public clear ( ) : void {
622
624
this . _registrations . forEach ( ( registration ) => {
623
625
registration . disposable . dispose ( ) ;
624
626
} ) ;
0 commit comments