Skip to content
Draft
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
4 changes: 3 additions & 1 deletion config.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ e.g. `PathMatch: [foo/.*, bar/.*]` matches files in either directory.

Conditions based on a file's path use the following form:

- if the fragment came from a project directory, the path is relative
- if the fragment came from a project directory, the path is relative
(note: `./dir/.*` is an incorrect form for `dir` content in the project's root
Copy link
Contributor

Choose a reason for hiding this comment

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

I have trouble understanding this sentence (not sure what the "regex perspective" refers to). And listing incorrect examples can add extra confusion. Could this be:

(e.g. for /proj/.clangd, the file /proj/x/y.cc has a path of x/y.cc)

Copy link
Author

Choose a reason for hiding this comment

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

Looks like I misunderstood @HighCommander4 explanation.
It's a common practice to start a path with ./ talking about relative paths. But the config parser doesn't understand that form, it requires starting away with the name, right?
"regex perspective" is my wrong explanation because regex with . special character can be any character including ., so according to my logic, it should have worked. Forget it.
Yeah, your example looks better in every sense.

from the regex perspective, use `dir/.*` instead)
- if the fragment is global (e.g. user config), the path is absolute
- paths always use forward-slashes (UNIX-style)

Expand Down