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

API: Support glob pattern "**/!(*.min).js" for file watchers #27051

Closed
TheColorRed opened this issue May 22, 2017 · 9 comments
Closed

API: Support glob pattern "**/!(*.min).js" for file watchers #27051

TheColorRed opened this issue May 22, 2017 · 9 comments
Labels
api feature-request Request for new features or functionality file-watcher File watcher *out-of-scope Posted issue is not in scope of VS Code
Milestone

Comments

@TheColorRed
Copy link

I am trying to write an extension, and I am wondering how I can take this pattern:

glob(vscode.workspace.rootPath + '/**/!(*.min).js', (err, files) => {
    console.log(files);
})

And use it here:

let watcher = vscode.workspace.createFileSystemWatcher('**/!(*.min).js', true, false, true);

It seems as if the !(*.min) is not supported. It would be nice if either:

A !() was supported
OR
B There is another parameter for ignoring files similar to vscode.workspace.findFiles()

@bpasero bpasero changed the title FileSystemWatcher glob pattern "**/!(*.min).js" doesn't work Support glob pattern "**/!(*.min).js" for file watchers May 23, 2017
@bpasero
Copy link
Member

bpasero commented May 23, 2017

Our glob patterns currently do not support negation.

@bpasero bpasero added feature-request Request for new features or functionality workbench labels May 23, 2017
@bpasero bpasero removed their assignment May 23, 2017
@bpasero bpasero added the file-watcher File watcher label Jun 8, 2017
@bpasero bpasero removed the workbench label Nov 16, 2017
@jpike88
Copy link

jpike88 commented Jan 16, 2018

What do they support then? There is nothing in your documentation about how they're supposed to work. If they don't support something as fundamental to pattern matching as a negation operator, that needs to be far more obvious whether it be in the program, or in documentation.

@bpasero bpasero added the file-glob File glob engine label Mar 28, 2018
@Xunnamius
Copy link

+1 on this, was wondering why my standard globs weren't working

@TheColorRed
Copy link
Author

@jpike88 and @Xunnamius It looks like they have added it to the docs: https://code.visualstudio.com/docs/extensionAPI/vscode-api#GlobPattern

@Jma353
Copy link

Jma353 commented May 8, 2019

Is there going to be future support for negation?

E.g. I have a situation where I want a language client (which also uses VS Code APIs to match file globs) to conditionally send LSP traffic to a server, based on where the document that's involved lives in the file-system. See this code pointer.

I would like to exclude certain subdirectories from my glob. Currently, to my understanding, I can't do this, unless I use per-character negation (as the vscode documentation indicates is supported), to do something like is mentioned in the following comment.

@Jma353
Copy link

Jma353 commented May 8, 2019

cc: @bpasero

@bpasero bpasero added the api label Oct 8, 2019
@bpasero bpasero changed the title Support glob pattern "**/!(*.min).js" for file watchers API: Support glob pattern "**/!(*.min).js" for file watchers Oct 8, 2019
@bpasero bpasero removed the file-glob File glob engine label Oct 8, 2019
@bpasero bpasero added this to the Backlog milestone Oct 24, 2019
@kimprice
Copy link
Member

What is the status on this issue? It would be very helpful to be able to exclude certain folders and files from the file watcher. I agree that having another parameter to specify exclusions would be one nice solution.

@bpasero bpasero added the *out-of-scope Posted issue is not in scope of VS Code label Nov 3, 2020
@bpasero bpasero closed this as completed Nov 3, 2020
@bpasero bpasero reopened this Nov 3, 2020
@bpasero bpasero added *out-of-scope Posted issue is not in scope of VS Code and removed *out-of-scope Posted issue is not in scope of VS Code labels Nov 3, 2020
@bpasero bpasero closed this as completed Nov 3, 2020
@matulek
Copy link

matulek commented Jul 11, 2021

Well, please reconsider. I've got a case where I need to exclude node_modules from source map lookups, but I've got my own module that I'm developing and this one needs to not be excluded. I think that it's a valid case and inability to negate path fragment from outFiles and resolveSourceMapLocations prevents from doing that. @bpasero

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api feature-request Request for new features or functionality file-watcher File watcher *out-of-scope Posted issue is not in scope of VS Code
Projects
None yet
Development

No branches or pull requests

8 participants
@Xunnamius @bpasero @TheColorRed @jpike88 @Jma353 @kimprice @matulek and others