Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected async onDidTaskFileChange(fileChanges: FileChange[]): Promise {
for (const change of fileChanges) {
if (change.type === FileChangeType.DELETED) {
this.removeTasks(change.uri);
} else {
// re-parse the config file
await this.refreshTasks(change.uri);
}
}
}
const key = rootStat.uri;
toDelete.delete(key);
if (!this.models.has(key)) {
const model = new TaskConfigurationModel(key, this.preferences);
model.onDidChange(() => this.onDidChangeTaskConfigEmitter.fire({ uri: key, type: FileChangeType.UPDATED }));
model.onDispose(() => this.models.delete(key));
this.models.set(key, model);
this.onDidChangeTaskConfigEmitter.fire({ uri: key, type: FileChangeType.UPDATED });
}
}
for (const uri of toDelete) {
const model = this.models.get(uri);
if (model) {
model.dispose();
}
this.onDidChangeTaskConfigEmitter.fire({ uri, type: FileChangeType.DELETED });
}
}, 500);