Repository navigation
Description
TS Template added by Matt Bierner (@mjbvz)
TypeScript Version: 3.7.3
Search Terms
- watcher
- watch
I have Visual Studio Code 1.41.1 on Ubuntu 18.04.
I have an Ember project, that builds into a tmp/ directory.
I have added this to the watch exclude list because it's large and changes regularly (eg. while running tests).
"files.watcherExclude": {
"**/web-ui/tmp/**": true,
},
I turned on verbose logging for tsserver (after reading many bugs and trying to identify the source of my CPU load). The logs show that changes inside the tmp directory are triggering something, which is probably why the CPU load is so high. Also, once this starts it seems to just loop forever? (or maybe it's just queued up the notifications).
Here's a sample of the part of the log that repeats.
Info 19646[14:51:17.385] DirectoryWatcher:: Triggered with /home/lincolnr/work/git/web-ui/tmp/funnel-output_path-84OVG1Ct.tmp :: WatchInfo: /home/lincolnr/work/git/web-ui 1 Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations
Info 19647[14:51:17.385] Elapsed:: 0ms DirectoryWatcher:: Triggered with /home/lincolnr/work/git/web-ui/tmp/funnel-output_path-84OVG1Ct.tmp :: WatchInfo: /home/lincolnr/work/git/web-ui 1 Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations
Info 19648[14:51:17.665] DirectoryWatcher:: Triggered with /home/lincolnr/work/git/web-ui/tmp/funnel-input_base_path-wnOSxgXB.tmp :: WatchInfo: /home/lincolnr/work/git/web-ui 1 Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations
Info 19649[14:51:17.665] Elapsed:: 0ms DirectoryWatcher:: Triggered with /home/lincolnr/work/git/web-ui/tmp/funnel-input_base_path-wnOSxgXB.tmp :: WatchInfo: /home/lincolnr/work/git/web-ui 1 Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations
Info 19650[14:51:17.959] DirectoryWatcher:: Triggered with /home/lincolnr/work/git/web-ui/tmp/funnel-input_base_path-wnOSxgXB.tmp :: WatchInfo: /home/lincolnr/work/git/web-ui 1 Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations
Info 19651[14:51:17.959] Elapsed:: 0ms DirectoryWatcher:: Triggered with /home/lincolnr/work/git/web-ui/tmp/funnel-input_base_path-wnOSxgXB.tmp :: WatchInfo: /home/lincolnr/work/git/web-ui 1 Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations
Info 19652[14:51:18.305] DirectoryWatcher:: Triggered with /home/lincolnr/work/git/web-ui/tmp/funnel-input_base_path-wnOSxgXB.tmp :: WatchInfo: /home/lincolnr/work/git/web-ui 1 Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations
Info 19653[14:51:18.305] Elapsed:: 0ms DirectoryWatcher:: Triggered with /home/lincolnr/work/git/web-ui/tmp/funnel-input_base_path-wnOSxgXB.tmp :: WatchInfo: /home/lincolnr/work/git/web-ui 1 Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations
Info 19654[14:51:18.606] DirectoryWatcher:: Triggered with /home/lincolnr/work/git/web-ui/tmp/broccoli_persistent_filterbabel__babel_ember_concurrency-input_base_path-KfhqeYgr.tmp :: WatchInfo: /home/lincolnr/work/git/web-ui 1 Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations
Info 19655[14:51:18.606] Elapsed:: 0ms DirectoryWatcher:: Triggered with /home/lincolnr/work/git/web-ui/tmp/broccoli_persistent_filterbabel__babel_ember_concurrency-input_base_path-KfhqeYgr.tmp :: WatchInfo: /home/lincolnr/work/git/web-ui 1 Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations
Info 19656[14:51:18.894] DirectoryWatcher:: Triggered with /home/lincolnr/work/git/web-ui/tmp/broccoli_persistent_filterbabel__babel_ember_concurrency-input_base_path-KfhqeYgr.tmp :: WatchInfo: /home/lincolnr/work/git/web-ui 1 Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations
Info 19657[14:51:18.894] Elapsed:: 0ms DirectoryWatcher:: Triggered with /home/lincolnr/work/git/web-ui/tmp/broccoli_persistent_filterbabel__babel_ember_concurrency-input_base_path-KfhqeYgr.tmp :: WatchInfo: /home/lincolnr/work/git/web-ui 1 Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations
Info 19658[14:51:19.177] DirectoryWatcher:: Triggered with /home/lincolnr/work/git/web-ui/tmp/broccoli_persistent_filterbabel__babel_ember_text_measurer-output_path-jaXKXveR.tmp :: WatchInfo: /home/lincolnr/work/git/web-ui 1 Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations
Info 19659[14:51:19.177] Elapsed:: 0ms DirectoryWatcher:: Triggered with /home/lincolnr/work/git/web-ui/tmp/broccoli_persistent_filterbabel__babel_ember_text_measurer-output_path-jaXKXveR.tmp :: WatchInfo: /home/lincolnr/work/git/web-ui 1 Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations
Info 19660[14:51:19.489] DirectoryWatcher:: Triggered with /home/lincolnr/work/git/web-ui/tmp/broccoli_persistent_filterbabel__babel_ember_text_measurer-cache_path-4KZn31rh.tmp :: WatchInfo: /home/lincolnr/work/git/web-ui 1 Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations
Info 19661[14:51:19.489] Elapsed:: 0ms DirectoryWatcher:: Triggered with /home/lincolnr/work/git/web-ui/tmp/broccoli_persistent_filterbabel__babel_ember_text_measurer-cache_path-4KZn31rh.tmp :: WatchInfo: /home/lincolnr/work/git/web-ui 1 Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations
Info 19662[14:51:19.798] DirectoryWatcher:: Triggered with /home/lincolnr/work/git/web-ui/tmp/broccoli_persistent_filterbabel__babel_ember_text_measurer-input_base_path-I4mIM5US.tmp :: WatchInfo: /home/lincolnr/work/git/web-ui 1 Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations
Info 19663[14:51:19.798] Elapsed:: 0ms DirectoryWatcher:: Triggered with /home/lincolnr/work/git/web-ui/tmp/broccoli_persistent_filterbabel__babel_ember_text_measurer-input_base_path-I4mIM5US.tmp :: WatchInfo: /home/lincolnr/work/git/web-ui 1 Project: /dev/null/inferredProject1* WatchType: Failed Lookup Locations
Is there something else I need to do to stop tsserver from watching this excluded directory?
I can upload the whole log if it helps.
Activity
vscodebot commentedon Jan 22, 2020
(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:
a1291762 commentedon Jan 22, 2020
To the bot: I have read through many bugs about high CPU load for tsserver.js/typingsInstaller.js but none of them seemed relevant to my specific situation (ts server log detecting changes to files that are supposed to be ignored).
Also... I apparently cannot upload logs.
I have the snap-based install, which maybe doesn't have that option?
mjbvz commentedon Jan 23, 2020
That TS server's file watcher is separate from
files.watcherExclude(which is what VS Code uses internally to update opened files and the list of files in the explorer)Do you have a
tsconfigorjsconfig? Can you try adding thattmpdirectory to theexcludesection of that?{ "compilerOptions": { ... }, "exclude": [ "**/web-ui/tmp/**" ] } ``a1291762 commentedon Jan 23, 2020
I failed to get exclude to work :(
I tried various patterns in the "exclude" array to no avail ("/tmp/", "tmp").
Since it's possibly relevant, I open a folder with VSCode: ~/work/git.
I have ~/work/git/web-ui that holds the Javascript (there are many other directories holding other things that are not Javascript)
I created ~/work/git/web-ui/jsconfig.json and VSCode is definitely seeing it.
I don't see anything about the exclude property in the tsserver.log, but it still hits files in tmp.
But while reading https://code.visualstudio.com/docs/languages/jsconfig I thought maybe include could work. I only have 4 folders with JS in them after all...
My jsconfig now has this:
I still don't see this mentioned in the tsserver.log, but I also don't see the watcher firing on files in tmp!
So I have a "solution" to my problem.
mjbvz commentedon Jan 24, 2020
Moving upstream for TypeScript team's awareness
sheetalkamat commentedon Jan 24, 2020
We don't have support to ignore watch directories yet, but #35615 enables us for that. we haven't gotten around to it yet. Note that typescript tries to optimize watches where in instead of watching all failed lookup locations we watch directory corresponding to it or something similar. Since your OS is ubuntu, we are creating recursive watches..
RyanCavanaugh commentedon Feb 26, 2020
Sheetal Nandi (@sheetalkamat) what's the follow-up recommendation for this now?
sheetalkamat commentedon Apr 22, 2020
For now if the folder for
web-uiwas one level below i think we would skip watching it but i am not 100% sure if we do it in all places or not (esp when creating recursive directory watching).Moving this to 4.0 to look into watch ignore pattern specification.