question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow to configure watcher to watch only opened files

See original GitHub issue

Problem: I am running VS Code on Linux in an environment where the maximum number of files I can watch is 8k. I do not have root permissions to change those settings. The workspaces I’m working on have multiple thousand source files and exceed this limit easily.

fs.inotify.max_user_instances = 128
fs.inotify.max_user_watches = 8192

What I’m looking for: I’m looking for a way to avoid running out of inotify watch slots, but still get notified if a file I have open in the editor changes, e.g. due to a git checkout to another branch.

I looked around in the code and in the documentation, and I’m unsure as to what behavior is actually expected w.r.t. the file watcher, open files, file watcher excludes, etc. I’m even unsure who consumes file watcher events for files which are not open in the editor, or in other words: what functionality breaks if some unopened files are not watched?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:27
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
beauxqcommented, May 20, 2022

Is there any way to see a list of the files vscode is trying to watch?

I tried adding all the large folders to files.watcherExclude, but it doesn’t seem to be working.

0reactions
the-supercoachcommented, Nov 19, 2022

Is there any way to see a list of the files vscode is trying to watch?

I tried adding all the large folders to files.watcherExclude, but it doesn’t seem to be working.

If you’re accessing a remote host, open the output panel (ctrl + shift + u) and then open the Remote Log. That should give you details of the watchers. I submitted a pull request for the inotify script that may also help - it shows the full command for the watcher processes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

File Watchers | IntelliJ IDEA Documentation - JetBrains
To enable or disable a File Watcher, open the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Tools | File Watchers, and select or...
Read more >
Use Intellij File Watcher only on Open File - Stack Overflow
Is there a way to set up File Watcher so it only watches a file that is currently open? I added a screenshot...
Read more >
Watcher settings in Elasticsearch - Elastic
This client is used in the HTTP input, the webhook, the slack, pagerduty, and jira actions. This setting can be updated dynamically. It...
Read more >
File Watchers - Help | IntelliJ IDEA - JetBrains
To enable or disable a File Watcher, open the Settings/Preferences dialog Ctrl+Alt+S , go to Tools | File Watchers, and select or clear...
Read more >
File Watcher - Visual Studio Marketplace
Extension for Visual Studio Code - Watch file or folder changes ... allows configuring commands that get run whenever a file is saved ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found