Skip to content

Commit

Permalink
deco - disable cleanup for now
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Oct 24, 2017
1 parent dd5e66e commit 5a1717d
Showing 1 changed file with 16 additions and 25 deletions.
41 changes: 16 additions & 25 deletions src/vs/workbench/services/decorations/browser/decorationsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,31 +150,22 @@ class DecorationStyles {
cleanUp(iter: IIterator<DecorationProviderWrapper>): void {
// remove every rule for which no more
// decoration (data) is kept. this isn't cheap
let usedDecorations = new Set<IDecorationData>();
for (let e = iter.next(); !e.done; e = iter.next()) {
e.value.data.forEach(value => {
if (value instanceof ResourceDecoration) {
if (Array.isArray(value._data)) {
value._data.forEach(data => usedDecorations.add(data));
} else {
usedDecorations.add(value._data);
}
}
});
}
this._decorationRules.forEach((value, index) => {
const { data } = value;
let remove: boolean;
if (Array.isArray(data)) {
remove = data.every(data => !usedDecorations.has(data));
} else if (!usedDecorations.has(data)) {
remove = true;
}
if (remove) {
value.removeCSSRules(this._styleElement);
this._decorationRules.delete(index);
}
});

// let usedDecorations = new Set<string>();
// for (let e = iter.next(); !e.done; e = iter.next()) {
// e.value.data.forEach(value => {
// if (value instanceof ResourceDecoration) {
// const key = DecorationRule.keyOf(value._data);
// usedDecorations.add(key);
// }
// });
// }
// this._decorationRules.forEach((value, index) => {
// if (!usedDecorations.has(index)) {
// value.removeCSSRules(this._styleElement);
// this._decorationRules.delete(index);
// }
// });
}
}

Expand Down

0 comments on commit 5a1717d

Please sign in to comment.