It'd be potentially useful to have ! as a prefix added to our glob.ts utils. This could function similarly to how we already handle .gitignore files in the webworker search here:
- if a file matches a normal line and doesn't match an
!-line, exclude it (we do this today)
- If it matches both a normal line and a
!-line, include it
- Otherwise, include it (we do this today)
This isn't quite as powerful as a real.gitignore as there are only two "layers" of include/exclude, whereas in gitignore each line introduces a new "layer", but I believe it would handle the 99% of cases well enough, for instance every example given to-date in #869.
To handle the many-layer case requires either:
- migrating to an array to configure
files.exclude and search.exclude, which is undesirable from a backwards/forwards compatibility perspective
- taking care to ensure the existing
*.exclude objects are handled in a key-order sensitive way, which is potentially undesirable from a JSON/JS object semantics compatibility perspective
cc @bpasero for any and all input on this
It'd be potentially useful to have
!as a prefix added to ourglob.tsutils. This could function similarly to how we already handle.gitignorefiles in the webworker search here:!-line, exclude it (we do this today)!-line, include itThis isn't quite as powerful as a real
.gitignoreas there are only two "layers" of include/exclude, whereas ingitignoreeach line introduces a new "layer", but I believe it would handle the 99% of cases well enough, for instance every example given to-date in #869.To handle the many-layer case requires either:
files.excludeandsearch.exclude, which is undesirable from a backwards/forwards compatibility perspective*.excludeobjects are handled in a key-order sensitive way, which is potentially undesirable from a JSON/JS object semantics compatibility perspectivecc @bpasero for any and all input on this