201
202
installResourceFilter(resource: URI, reason: string): IDisposable {
204
>
205
>
if (!reasons) {
206
>
reasons = [];
207
>
this._filteredResources.set(resource, reasons);
208
>
}
209
>
reasons.push(reason);
210
>
this._onMarkerChanged.fire([resource]);
211
>
212
>
return toDisposable(() => {
213
>
const reasons = this._filteredResources.get(resource);
214
>
if (!reasons) {
215
return;
216
}
218
>
if (reasonIndex !== -1) {
219
>
reasons.splice(reasonIndex, 1);
220
>
if (reasons.length === 0) {
221
>
this._filteredResources.delete(resource);
222
>
}
223
>
this._onMarkerChanged.fire([resource]);
224
>
}
225
>
});
226
>
}
227
228
private static _toMarker(owner: string, resource: URI, data: IMarkerData): IMarker | undefined {