Vscode: Exclude gitignored files from file watcher

Created on 7 Nov 2018  路  12Comments  路  Source: microsoft/vscode

I would like an option to disable watching of gitgnored files (i.e. add them to the files.watcherExclude option automatically).

I think this makes sense, at least I couldn't think of a use case for watching gitignored files. It might also help with autorefresh related issues and could make the files.watcherExclude option thinner.

feature-request file-watcher

Most helpful comment

+1 for this feature. I've had to add many lines to files.watcherExclude to get rid of the "unable to watch for file changes in this large workspace" warning. It _is_ a large workspace (around 20 separate Git repos), but 90% of the things I specify in files.watcherExclude could be automatically read in from the various .gitignore files. Maybe I'll make a fork tonight and try to figure out what it would take to implement this.

All 12 comments

/findDuplicates

Also checked, couldn't find anything about this. Other gitignore related issues are mostly about search and explorer, but the idea is similar.

+1 for this feature. I've had to add many lines to files.watcherExclude to get rid of the "unable to watch for file changes in this large workspace" warning. It _is_ a large workspace (around 20 separate Git repos), but 90% of the things I specify in files.watcherExclude could be automatically read in from the various .gitignore files. Maybe I'll make a fork tonight and try to figure out what it would take to implement this.

I just discovered VSCode wasn't doing this by default the worst way possible...

A bunch of tabs in Chromium were crashing (I was getting that "Oh snap!" message), other programs becoming unresponsive.... So I opened the system monitor and noticed the CPU usage of VSCode was really high, and the memory usage was peaking at 5-6 GB (I have 8 GB).

That was happening because I'm building a Flatpak program, and I'm using flatpak-builder to do so:

$ flatpak-builder build-dir/ org.flatpak.Hello.json

Unfortunately (for me), flatpak-builder creates two symbolic links pointing to /run: The first one inside build-dir/ and the other one inside .flatpak-build/. I didn't think much of it because I had those two directories in my .gitignore...

But because File Watcher doesn't read paths from .gitignore, it was basically trying to map the entire filesystem, plus my external hard drives. 馃し鈥嶁檪

This repeatedly hurts me. I tend to have a small number of source files, but quite large folders in my .gitignore. Those can have tens of thousands of files. Please, please, please add a default or toggle to black-list everything in the gitignore globs from the watcher process.

+1 to this feature, would really help in excluding the same folders twice.

Another +1 on this one. This also plays in the whole idea of "maintaining only source code on git" and for most repositories, the .gitignore will already contain all of the files that shouldn't be watched anyways.

+1 to this. What are included in .gitignore 99% match what should be excluded by the watcher. This feature would be very convenient.

If added it would nice it worked the same as "search.useIgnoreFiles", looking at both .gitignore and .ignore so that some gitignore entries can be overriden (e.g. sub-repos).

Yet another +1 to for this feature request. I have a small repo which generates hundreds of thousands of files ... this is common in data science when data is being acquired from external points of truth but need to be stored (and IGNORED!) locally.

+1 on this.

I work with a large builds, that produce hundreds of thousands of files along the way. I have a nice .gitignore for my project. I wish that Vscode could just detect it and respect it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

borekb picture borekb  路  3Comments

VitorLuizC picture VitorLuizC  路  3Comments

trstringer picture trstringer  路  3Comments

curtw picture curtw  路  3Comments

philipgiuliani picture philipgiuliani  路  3Comments