Skip to content

Commit 17b51df

Browse files
allow exact match
1 parent 9df1acb commit 17b51df

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

src/configurationProvider.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -491,24 +491,33 @@ export class JavaDebugConfigurationProvider implements vscode.DebugConfiguration
491491
for (const p of paths) {
492492
if (p.startsWith("!")) {
493493
let exclude = p.substr(1);
494+
let isDirect: boolean;
494495
if (!path.isAbsolute(exclude)) {
495496
exclude = path.join(folder?.uri.fsPath || "", exclude);
496497
}
498+
499+
if (exclude.endsWith("/")) {
500+
exclude = exclude.substr(0, exclude.length - 1);
501+
isDirect = true;
502+
} else {
503+
isDirect = this.isFilePath(exclude);
504+
}
505+
497506
// use Uri to normalize the fs path
498-
excludes.set(vscode.Uri.file(exclude).fsPath, this.isFilePath(exclude));
507+
excludes.set(vscode.Uri.file(exclude).fsPath, isDirect);
499508
continue;
500509
}
501510

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

505514
return result.filter((r) => {
506-
for (const [excludedPath, isFile] of excludes.entries()) {
507-
if (isFile && r === excludedPath) {
515+
for (const [excludedPath, isDirect] of excludes.entries()) {
516+
if (isDirect && r === excludedPath) {
508517
return false;
509518
}
510519

511-
if (!isFile && r.startsWith(excludedPath)) {
520+
if (!isDirect && r.startsWith(excludedPath)) {
512521
return false;
513522
}
514523
}

0 commit comments

Comments
 (0)