FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Allow Exact Match For Filters by tthornton3-chwy · Pull Request #1649 · microsoft/vscode-java-debug · GitHub

Allow Exact Match For Filters - #1649

Open
tthornton3-chwy wants to merge 4 commits into
microsoft:mainfrom
tthornton3-chwy:feature/allow-exact-match
Open

Allow Exact Match For Filters#1649
tthornton3-chwy wants to merge 4 commits into
microsoft:mainfrom
tthornton3-chwy:feature/allow-exact-match

Conversation

Copy link
Copy Markdown
Contributor

I was having cases where filters were matching inappropriately, for example with composite builds. This lets you have an exact match syntax. I know it's a bit niche, but I do think it's useful/I personally use it!

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

Copy link
Copy Markdown
Contributor

Thanks, this is a reasonable addition and the trailing-separator approach is backward compatible. One blocker and two smaller asks before merge:

Windows separator gap. The typical config form is !${workspaceFolder}/build/classes/ — after resolution that's an absolute path with forward slashes and a trailing /. Since it's absolute, path.join is skipped, so on Windows exclude.endsWith('\\') is false and exact-match silently never triggers. A Windows user would have to hand-write backslashes. Suggest making the check separator-agnostic and running it before normalization:

if (/[\\/]$/.test(exclude)) {
    exclude = exclude.slice(0, -1);
    isDirect = true;
} else {
    isDirect = this.isFilePath(exclude);
}

Docs. The trailing-slash convention isn't discoverable — can you update java.debugger.launch.classPaths.exclude and modulePaths.exclude in package.nls.json to mention it? It's also slightly counter-intuitive (a trailing slash usually implies a directory/prefix, here it means exact match), so a clear note helps.

Test. A small unit test covering the new exact-match path in filterExcluded would be good given this logic is filesystem-sensitive and currently untested.

Copy link
Copy Markdown
Contributor Author

Changyong Gong (@chagong) I finally got around to addressing the (very good!) feedback :) Can you re-take a peek?

let exclude = p.slice(1);
let isDirect: boolean;

if (/[\\/]$/.test(exclude)) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

before normalization, and using the exact code-block suggested, per feedback!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL