Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions src/configurationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -491,24 +491,33 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
for (const p of paths) {
if (p.startsWith("!")) {
let exclude = p.substr(1);
let isDirect: boolean;
if (!path.isAbsolute(exclude)) {
exclude = path.join(folder?.uri.fsPath || "", exclude);
}

if (exclude.endsWith(process.platform === 'win32' ? '\\' : '/')) {
exclude = exclude.substr(0, exclude.length - 1);
isDirect = true;
} else {
isDirect = this.isFilePath(exclude);
}

// use Uri to normalize the fs path
excludes.set(vscode.Uri.file(exclude).fsPath, this.isFilePath(exclude));
excludes.set(vscode.Uri.file(exclude).fsPath, isDirect);
continue;
}

result.push(vscode.Uri.file(p).fsPath);
}

return result.filter((r) => {
for (const [excludedPath, isFile] of excludes.entries()) {
if (isFile && r === excludedPath) {
for (const [excludedPath, isDirect] of excludes.entries()) {
if (isDirect && r === excludedPath) {
return false;
}

if (!isFile && r.startsWith(excludedPath)) {
if (!isDirect && r.startsWith(excludedPath)) {
return false;
}
}
Expand Down