mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 20:13:32 +01:00
Allow trackobject to take undefined
This commit is contained in:
@@ -21,7 +21,7 @@ export interface IHeapService {
|
||||
/**
|
||||
* Track gc-collection for the given object
|
||||
*/
|
||||
trackObject(obj: ObjectIdentifier): void;
|
||||
trackObject(obj: ObjectIdentifier | undefined): void;
|
||||
}
|
||||
|
||||
export class HeapService implements IHeapService {
|
||||
|
||||
@@ -137,9 +137,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
|
||||
if (dto) {
|
||||
dto.forEach(obj => {
|
||||
this._heapService.trackObject(obj);
|
||||
if (obj.command) {
|
||||
this._heapService.trackObject(obj.command);
|
||||
}
|
||||
this._heapService.trackObject(obj.command);
|
||||
});
|
||||
}
|
||||
return dto;
|
||||
@@ -149,9 +147,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
|
||||
return this._proxy.$resolveCodeLens(handle, model.uri, codeLens, token).then(obj => {
|
||||
if (obj) {
|
||||
this._heapService.trackObject(obj);
|
||||
if (obj.command) {
|
||||
this._heapService.trackObject(obj.command);
|
||||
}
|
||||
this._heapService.trackObject(obj.command);
|
||||
}
|
||||
return obj;
|
||||
});
|
||||
@@ -274,11 +270,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
|
||||
provideCodeActions: (model: ITextModel, rangeOrSelection: EditorRange | Selection, context: modes.CodeActionContext, token: CancellationToken): Promise<modes.CodeAction[]> => {
|
||||
return this._proxy.$provideCodeActions(handle, model.uri, rangeOrSelection, context, token).then(dto => {
|
||||
if (dto) {
|
||||
dto.forEach(obj => {
|
||||
if (obj.command) {
|
||||
this._heapService.trackObject(obj.command);
|
||||
}
|
||||
});
|
||||
dto.forEach(obj => { this._heapService.trackObject(obj.command); });
|
||||
}
|
||||
return MainThreadLanguageFeatures._reviveCodeActionDto(dto);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user