Skip to content

Read-only mode settings - glob pattern consistency #182290

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

Closed
gjsjohnmurray opened this issue May 12, 2023 · 2 comments
Closed

Read-only mode settings - glob pattern consistency #182290

gjsjohnmurray opened this issue May 12, 2023 · 2 comments
Assignees
Labels
*as-designed Described behavior is as designed file-glob File glob engine under-discussion Issue is under discussion for relevance, priority, approach

Comments

@gjsjohnmurray
Copy link
Contributor

Type: Bug

Testing the new feature described in #4873 (comment) I found I needed this syntax in order to make files opened from node_modules open read-only:

	"files.readonlyInclude": {
		"**/node_modules/**": true
	}

Initially I had omitted the trailing /** because I based my entry on these models from defaultSettings.json, but that didn't work:

	"search.exclude": {
		"**/node_modules": true,
		"**/bower_components": true,
		"**/*.code-search": true
	},
	"explorer.autoRevealExclude": {
		"**/node_modules": true,
		"**/bower_components": true
	},

But I also found this in the same file, which uses a /*/** suffix:

	"files.watcherExclude": {
		"**/.git/objects/**": true,
		"**/.git/subtree-cache/**": true,
		"**/node_modules/*/**": true,
		"**/.hg/store/**": true
	},

I'd like to understand why these differences exist, and whether they are necessary.

VS Code version: Code - Insiders 1.79.0-insider (2575777, 2023-05-12T05:21:06.392Z)
OS version: Windows_NT x64 10.0.22621
Modes:
Sandboxed: Yes

@bpasero
Copy link
Member

bpasero commented May 12, 2023

Thanks for testing!

They are: the files.exclude and search.exclude settings are special because they are applied during tree traversal for each folder they encounter (e.g. explorer).

In most other cases we do not have tree traversal and thus the pattern needs to apply on the full path.

@bpasero bpasero self-assigned this May 12, 2023
@bpasero bpasero added under-discussion Issue is under discussion for relevance, priority, approach file-glob File glob engine *as-designed Described behavior is as designed labels May 12, 2023
@vscodenpa
Copy link

The described behavior is how it is expected to work. If you disagree, please explain what is expected and what is not in more detail. See also our issue reporting guidelines.

Happy Coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale May 14, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jun 28, 2023
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 file-glob File glob engine under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

No branches or pull requests

3 participants