-
Notifications
You must be signed in to change notification settings - Fork 207
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
fix for including excluded and vice versa #1067
base: main
Are you sure you want to change the base?
Conversation
@microsoft-github-policy-service agree |
Thank you for looking into this. We try to follow the behaviour of npm packages to some degree and it's currently unclear to me if npm supports exclude patterns in their If we decide on taking this we will need to add more tests here. |
It was unclear to me too - all I saw in the documentation was that "File patterns follow a similar syntax to .gitignore, but reversed.", and unofficial sources like https://medium.com/trabe/control-what-you-publish-inside-your-npm-packages-e3ec911638b8 I assumed not supporting files and .vscodeignore together was a deliberate attempt to avoid confusion; and if they both have the same expressive power why do you need the .vscodeignore at all (other than for legacy reasons)? When you say 'we will need to add more tests' is the 'we' me or you? :) |
Just wanted to add, regardless of having exclude patterns in the files property, the real problem I was trying to fix was that I couldn't find a way to tell vsce that I wanted all the files in the 'assets' folder except the psds. In .vscodeignore:
because the excludes are processed before the includes, it becomes
so the psd clause is overridden |
@benibenj I added a file to the unit tests with explicit exclusion in the "files": [
"foo",
"!**/exclude.me", <-- I added
"foo2/bar2/include.me",
"*/bar3/**",
"package.json",
"LICENSE",
"README.md"
] Then I added this file that's implicitly included by the
With these changes the tests all pass. Are there any other tests you'd like to see on this feature? It definitely makes sense to be matching the
I was going to say the documentation is inconsistent, but it actually consistently says this. AI tools, Gemini specifically, seem to very much disagree, so I think it's a matter of time before the In the worst case we include this and we end up supporting something in vscode better than the actual tool, which is potentially misleading until the tool fixes it. On the other hand, it seems to me it's a matter of time until this is supported by npm, especially with Gemini being confused about it, and the ramifications of it becoming supported in npm and the vscode extension failing that is worse than the alternative. The docs say including an excludes with a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed and then added the test. Considering the test is very little and I did the reformatting I was going to request, I'm approving.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
I reported this earlier today, but then thought I'd have a go fixing it, and... behold!
I won't be offended if you don't use this - I am not a javascript expert.