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

files.exclude and files.watcherExclude have different behaviour for same globs #29630

Closed
sandy081 opened this issue Jun 27, 2017 · 3 comments
Closed
Assignees
Labels
*as-designed Described behavior is as designed workbench-multiroot Multi-root (multiple folders) issues

Comments

@sandy081
Copy link
Member

Testing #29478

In a multi root workspace, for a second folder you have following folder settings

	"files.exclude": {
		"**/.git": true,
		"**/.svn": true,
		"**/.hg": true,
		"**/CVS": true,
		"**/.DS_Store": true,
		"**/samples": true
	}

Folder samples and its files are excluded, which is good.
Now have following folder settings for it

	"files.watcherExclude": {
		"**/.git/objects/**": true,
		"**/.git/subtree-cache/**": true,
		"**/node_modules/**": true,
		"**/samples": true
	},
	"files.exclude": {
		"**/.git": true,
		"**/.svn": true,
		"**/.hg": true,
		"**/CVS": true,
		"**/.DS_Store": true,
		"**/samples": false
	}

Folder samples and its files are shown. But watcher is not excluding files under samples folder.

@vscodebot vscodebot bot added the git GIT issues label Jun 27, 2017
@sandy081 sandy081 assigned Tyriar and unassigned joaomoreno Jun 27, 2017
@sandy081 sandy081 added workbench-multiroot Multi-root (multiple folders) issues and removed git GIT issues labels Jun 27, 2017
@Tyriar
Copy link
Member

Tyriar commented Jun 27, 2017

@roblourens @bpasero thoughts? It makes sense to me that "**/samples": true would only prevent events on that folder, otherwise there's no reason for the /**?

@roblourens
Copy link
Member

I think the files.exclude behavior currently makes sense, and watcherExclude should match that, unless there's a good reason you'd want to exclude a folder but not its children.

@bpasero
Copy link
Member

bpasero commented Jun 28, 2017

Well this is an issue with how the pattern is applied: In a tree structure (e.g. explorer) the exclude pattern works because we simply start to ignore everything once we reach the samples folder. For the watcher however, everything is watched by default and we need to apply the pattern against absolute paths (anything within samples) so the pattern will never match unless an absolute path is provided as pattern (or a ** is used at the end).

To be honest, I would not invest too much into the watcher exclude setting, it is debt and should go away eventually.

@Tyriar Tyriar closed this as completed Jun 28, 2017
@Tyriar Tyriar added the *as-designed Described behavior is as designed label Jun 28, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*as-designed Described behavior is as designed workbench-multiroot Multi-root (multiple folders) issues
Projects
None yet
Development

No branches or pull requests

5 participants