Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
disposables.push(this.fileSystemWatcher.onFilesChanged(changes => {
for (const change of changes) {
const fileChangeType = change.type;
if (ignoreCreateEvents === true && fileChangeType === FileChangeType.ADDED) {
continue;
}
if (ignoreChangeEvents === true && fileChangeType === FileChangeType.UPDATED) {
continue;
}
if (ignoreDeleteEvents === true && fileChangeType === FileChangeType.DELETED) {
continue;
}
const uri = change.uri.toString();
const codeUri = change.uri['codeUri'];
if (testGlob(globPattern, uri)) {
if (fileChangeType === FileChangeType.ADDED) {
onDidCreateEmitter.fire(codeUri);
} else if (fileChangeType === FileChangeType.UPDATED) {
onDidChangeEmitter.fire(codeUri);
} else if (fileChangeType === FileChangeType.DELETED) {
disposables.push(this.fileSystemWatcher.onFilesChanged(changes => {
for (const change of changes) {
const fileChangeType = change.type;
if (ignoreCreateEvents === true && fileChangeType === FileChangeType.ADDED) {
continue;
}
if (ignoreChangeEvents === true && fileChangeType === FileChangeType.UPDATED) {
continue;
}
if (ignoreDeleteEvents === true && fileChangeType === FileChangeType.DELETED) {
continue;
}
const uri = change.uri.toString();
const codeUri = change.uri['codeUri'];
if (testGlob(globPattern, uri)) {
if (fileChangeType === FileChangeType.ADDED) {
onDidCreateEmitter.fire(codeUri);
} else if (fileChangeType === FileChangeType.UPDATED) {
onDidChangeEmitter.fire(codeUri);
} else if (fileChangeType === FileChangeType.DELETED) {
onDidDeleteEmitter.fire(codeUri);
} else {
throw new Error(`Unexpected file change type: ${fileChangeType}.`);
}
}
}
}));
return {