提交 1c181b43 编写于 作者: J Johannes Rieken

remove dispose workaround and improve dispose logic, #84726

上级 ea6b3bd6
......@@ -243,9 +243,8 @@ export class CodeLensWidget {
}
dispose(helper: CodeLensHelper, viewZoneChangeAccessor?: editorBrowser.IViewZoneChangeAccessor): void {
while (this._decorationIds.length) {
helper.removeDecoration(this._decorationIds.pop()!);
}
this._decorationIds.forEach(helper.removeDecoration, helper);
this._decorationIds = [];
if (viewZoneChangeAccessor) {
viewZoneChangeAccessor.removeZone(this._viewZoneId);
}
......@@ -263,11 +262,9 @@ export class CodeLensWidget {
}
updateCodeLensSymbols(data: CodeLensItem[], helper: CodeLensHelper): void {
while (this._decorationIds.length) {
helper.removeDecoration(this._decorationIds.pop()!);
}
this._decorationIds.forEach(helper.removeDecoration, helper);
this._decorationIds = [];
this._data = data;
this._decorationIds = new Array<string>(this._data.length);
this._data.forEach((codeLensData, i) => {
helper.addDecoration({
range: codeLensData.symbol.range,
......
......@@ -227,7 +227,6 @@ export class ReferenceWidget extends peekView.PeekViewWidget {
this.setModel(undefined);
this._callOnDispose.dispose();
this._disposeOnNewModel.dispose();
this._preview.setModel(null); // drop all view-zones, workaround for https://github.com/microsoft/vscode/issues/84726
dispose(this._preview);
dispose(this._previewNotAvailableMessage);
dispose(this._tree);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册