Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there a way to watch multiple file types with vscode.workspace.createFileSystemWatcher

I'd like to be able to watch for multiple file types. **/*.spsrc and **/*.spinc do I have to watch for **/*.* instead and filter the extra notifications?

like image 638
cdturner Avatar asked Sep 06 '25 03:09

cdturner


1 Answers

No, this can be done with a single watcher. Relevant section from the GlobPattern docs:

Glob patterns can have the following syntax:

[....]

  • {} to group conditions (e.g. **​/*.{ts,js} matches all TypeScript and JavaScript files)

So for your example, that would look like this:

vscode.workspace.createFileSystemWatcher("**/*.{spsrc,spinc}");
like image 92
Gama11 Avatar answered Sep 09 '25 01:09

Gama11