Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add path usage example in If section #74

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

amordo
Copy link

@amordo amordo commented Nov 30, 2022

I've added path usage example as discussed with @HighCommander4 here.
The page fragment:
image

@@ -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.

@amordo amordo marked this pull request as draft December 1, 2022 22:01
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