-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
includes option underneath the existing excludes option #883
Comments
So you want to exclude everything except for
|
Unless you're using own glob implementation - not supported in vscode microsoft/vscode#869 |
This would also be useful to allow hiding the vendor folder in the explorer, if it override the top level files.exclude:
|
@bmewburn Can you point to a documentation for the supported glob patterns? I also have the case where basically I want to say: Exclude everything in |
Should have opened my eyes - it's probably https://github.com/mrmlnc/fast-glob as mentioned in the README. Will check if it's possible to solve the problem with a nifty glob pattern. |
@bmewburn I would say the following pattern should work - but it doesn't: "intelephense.files.exclude": [
"!**/vendor/foo/bar",
"**/vendor/**/{Test,Tests,test,tests}/**"
] It should exclude all the test directories except all the files from const fg = require('fast-glob');
const entries = fg.sync([
"!**/vendor/foo/bar",
"**/vendor/**/{Test,Tests,test,tests}/**"
]);
console.log(entries); Here the result is the correct list of all files and does not include So I assume that glob expansion of excludes is implemented a bit different. Any ideas? |
@mikehaertl These patterns are probably going to vscode api function itself (like this) But if you're really, really, reeeaaaally desperate: |
This call only expects glob patterns for a directory to watch. But this issue is about the exclude pattern. So even if this API method is used I assume that the list of directories/patterns to watch is first checked agains the exclude patterns somehow. BTW thanks for the workaround - it's indeed quite ugly, so a proper fix would be nice. |
@mikehaertl I've copied wrong link, I meant next one: There isn't good way to "fix" it in intelephense without bypassing build-in api, which is very bad idea, because you can have custom FileSystemProviders in vscode and these won't be supported by fast-glob etc. For this feature, please upvote following issue microsoft/vscode#869 |
@KapitanOczywisty I see, thanks. But looking at how old that issue is we can safely assume that this will never get fixed. Too bad. |
@mikehaertl They're trying to include older issues in every iteration and issues with more recent activity have higher chance to be worked on. |
with the addition of vscode's proper remote development extension this became mostly a non-issue for me as sshfs is no longer choking (or even being used) on scanning files i don't even care about. it still seems like it could be nice to avoid getting pointless suggestions, but as a critical need now not any more. |
The vscode file finding api was used in the past but then this functionality was moved server side (to support other editors) and fast-glob is now used. So any pattern in fast-glob should work. @mikehaertl in your fast-glob test it looks like you not using the |
@bmewburn From another test it seems that it's really an issue with fs-glob and there's already a related issue: mrmlnc/fast-glob#86 which unfortunately is not fixed yet despite being 2 years old. If you agree that this causes the problem I'll add a comment with the following example there:
const fg = require('fast-glob');
const entries = fg.sync(
[
"**/*.txt"
],
{
ignore: [
"!**/vendor/a/test",
"**/vendor/**/test/*.txt"
]
}
);
console.log(entries);
Expected result:
|
@zorac As a workaround, you can use |
Feature description or problem with existing feature
an includes option that operates on the principle of exclude > include. to get things to work well on our codebase i had to add a bunch of lines to our excludes to make sure that it only scans folders that contain php classes, especially skipping a symlink to a remote filesystem.
in our project this only leaves most of
vendor
, and ourcore
folder which is a psr0 autoload dir.Describe the solution you'd like
where if include is an empty array or null, you'd fall back to the current behaviour of it just scanning the entire workspace for backwards compat.
Additional context
each of our projects is going to need the excludes in the workspace
.vscode/settings.json
but with minor variations. it would be nice if we could first tell it "you are allowed to go here, but still skip some of this crap"additionally, the next folder that gets added to the project by someone who doesn't have my experience trying to get it all working might not know they need to add that to the excludes. this makes it also a handy extra-cautious future proofing against freshmen on the dev team.
cheers m8
The text was updated successfully, but these errors were encountered: