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

Introduce negate pattern in files.exclude #152225

Closed

Conversation

dankox
Copy link

@dankox dankox commented Jun 15, 2022

This PR fixes #869

Check files.exclude setting and extract all negate patterns from it into separate "include files" list.
To allow ! as a first character of file name to be excluded, user should use backslash:

"files.exclude": {
	"*.js": true,
	"!gulpfile.js": true,
	"\\!my_exclude_file.txt": true  // needs double backslash to backslash the backslash :)
},

@ghost
Copy link

ghost commented Jun 15, 2022

CLA assistant check
All CLA requirements met.

@lramos15
Copy link
Member

File excludes are used in more than the explorer such as in search so this change has to be done on the glob parser.

@dankox
Copy link
Author

dankox commented Jun 15, 2022

@lramos15 oh I see... and adding similar logic to getExcludes() in search.ts file wouldn't be enough?
I'm just asking, because if it would be, I could look into it too. However, if it's not the way you want it, then feel free to discard this change.

@bpasero
Copy link
Member

bpasero commented Jun 16, 2022

I suggest to follow through #134415 and also note the branch I had started, maybe pick it up. from there: https://github.com/microsoft/vscode/tree/ben/134415

@dankox
Copy link
Author

dankox commented Jun 16, 2022

@bpasero thanks for the heads up. So in such case I'm going to close this PR as I see there is the ongoing implementation of negate-pattern in glob which makes more sense. I might checkout your branch to try it as I was using this one for me internally for now.

@dankox dankox closed this Jun 16, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jul 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exclude all files except for...
3 participants