in src/configurationProvider.ts [425:455]
private async filterExcluded(folder: vscode.WorkspaceFolder | undefined, paths: string[]): Promise<string[]> {
const result: string[] = [];
const excludes: Map<string, boolean> = new Map<string, boolean>();
for (const p of paths) {
if (p.startsWith("!")) {
let exclude = p.substr(1);
if (!path.isAbsolute(exclude)) {
exclude = path.join(folder?.uri.fsPath || "", exclude);
}
// use Uri to normalize the fs path
excludes.set(vscode.Uri.file(exclude).fsPath, this.isFilePath(exclude));
continue;
}
result.push(vscode.Uri.file(p).fsPath);
}
return result.filter((r) => {
for (const [excludedPath, isFile] of excludes.entries()) {
if (isFile && r === excludedPath) {
return false;
}
if (!isFile && r.startsWith(excludedPath)) {
return false;
}
}
return true;
});
}