- Notifications
You must be signed in to change notification settings - Fork13.2k
Add watchOptions to tsconfig and allow supplying them on command line as well#35615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
typescript-bot commentedDec 10, 2019
Thanks for the PR! It looks like you've changed the TSServer protocol in some way. Please ensure that any changes here don't break consumers of the current TSServer API. For some extra review, we'll ping@sheetalkamat,@amcasey,@mjbvz,@minestarks for you. Feel free to loop in other consumers/maintainers if necessary |
sheetalkamat commentedDec 10, 2019
@typescript-bot pack this |
typescript-bot commentedDec 10, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Heya@sheetalkamat, I've started to run the tarball bundle task on this PR at11d7f4f. You can monitor the buildhere. It should now contribute to this PR's status checks. |
typescript-bot commentedDec 10, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hey@sheetalkamat, I've packed this intoan installable tgz. You can install it for testing by referencing it in your and then running There is also a playgroundfor this build. |
aranhaagency commentedDec 13, 2019
Nice work! |
andreialecu commentedDec 31, 2019
Should this help with#33335 ? If so, are there any aditional steps necessary? I've installed the latest nightly and selected it in VS Code but it doesn't seem to have helped. |
| constfileWatcherAddedLog=[ | ||
| "FileWatcher:: Added:: WatchInfo: /f.ts 250 Source file\n", | ||
| "FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 Source file\n" | ||
| "FileWatcher:: Added:: WatchInfo: /f.ts 250undefinedSource file\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
What doesundefined refer to here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
undefined is watchOptions passed to the file watcher
| name:"synchronousWatchDirectory", | ||
| type:"boolean", | ||
| category:Diagnostics.Advanced_Options, | ||
| description:Diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
As a user, is this relevant to me? What do I need to know? It's not clear to me what this option does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Also, what's the default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
default is false and setting this to true would get you behaviour in 3.7.. This is new flag that when not set, on recursive directory watching doesnt update the watcher status right away but instead sets a timeout to update the watches for recursive structure.. (eg. when say removing or creating node_modules folder, while npm install is going, the recursive watchers aren't updated right away but on timeout so we aren't eg adding watches on directories that will anyways be deleted or recreated..)
DanielRosenwasserJan 7, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Who would you say would use this feature? Here's how I'm describing it.
Disable deferred watching on directories. Deferred watching is useful when lots of file changes might occur at once (e.g. a change in
node_modulesfrom runningnpm install), but you might want to disable it with this flag for some atypical setups.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is kind of backup flag that can disable this behavior if changes aren't reflected correctly/sooner.
| description:Diagnostics.Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling, | ||
| }, | ||
| { | ||
| name:"fallbackPolling", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Is this polling for files, directories, or both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Its for both.. Any fallback when filesystem native fails uses this method
Uh oh!
There was an error while loading.Please reload this page.
watchOptionsas entry parallel tocompilerOptionsin tsconfig to specifywatchspecific options. Eg.watchFilestrategy etc. It would also allow us to set ignores for watches or some such options in future, or allowing delayed project watches in the server and others.watchFilestrategy to watch files,watchDirectorystrategy to watch individual directory on the OS that don't support native recursive watching andfallbackPollingmethod to poll when fs related watching fails.synchronousWatchDirectoryinwatchOptionsFixes100% CPU when installing node_modules while a file is open #30208,VSCode and intellisense are broken and unstable #32033,Code Helper high CPU (electron_node tsserver.js) #34401