src/vs/workbench/contrib/tasks/common/problemCollectors.ts/WatchingProblemCollector/constructor
class WatchingProblemCollector:	constructor(problemMatchers: ProblemMatcher[], markerService: IMarkerService, modelService: IModelService, fileService?: IFileService) {
		super(problemMatchers, markerService, modelService, fileService);
		this.resetCurrentResource();
		this.backgroundPatterns = [];
		this._activeBackgroundMatchers = new Set<string>();
		this.problemMatchers.forEach(matcher => {
			if (matcher.watching) {
				const key: string = generateUuid();
				this.backgroundPatterns.push({
					key,
					matcher: matcher,
					begin: matcher.watching.beginsPattern,
					end: matcher.watching.endsPattern
				});
				this.beginPatterns.push(matcher.watching.beginsPattern.regexp);
			}
		});

		this.modelListeners.add(this.modelService.onModelRemoved(modelEvent => {
			let markerChanged: IDisposable | undefined =
				Event.debounce(this.markerService.onMarkerChanged, (last: readonly URI[] | undefined, e: readonly URI[]) => {
					return (last ?? []).concat(e);
				}, 500)(async (markerEvent) => {
					markerChanged?.dispose();
					markerChanged = undefined;
					if (!markerEvent.includes(modelEvent.uri) || (this.markerService.read({ resource: modelEvent.uri }).length !== 0)) {
						return;
					}
					const oldLines = Array.from(this.lines);
					for (const line of oldLines) {
						await this.processLineInternal(line);
					}
				});
			setTimeout(async () => {
				markerChanged?.dispose();
				markerChanged = undefined;
			}, 600);
		}));
	}