I solved this by changing this in Fedora Linux (I imagine it would be the same in systems that have sysctl), the problem seems to be that VSC is not able to watch changes in a file because the workspace is too large. To do this you must increase the max_user_watches
in /etc/sysctl.conf
by adding the following:
fs.inotify.max_user_watches=524288
You can see the current value by running:
cat /proc/sys/fs/inotify/max_user_watches
Then to load the new value run sudo sysctl -p
Also if we don't want to modify the value we must go to the root of the problem, which is that the workspace is too big, to solve it we can tell VSC to skip certain directories. This can be added in the settings.json of your choice or via the settings UI in my case I have added these in User Settings (JSON):
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/*/**": true,
"**/.hg/store/**": true,
"**/vendor/*/**": true,
}
In my case, the first 4 patterns were already there, so by adding the vendor (the project is with Laravel) it already works for me.
Source: "Visual Studio Code is unable to watch for file changes in this large workspace" (error ENOSPC)