-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Watch improvements in tsserver #17269
Merged
Merged
Changes from 118 commits
Commits
Show all changes
128 commits
Select commit
Hold shift + click to select a range
21ad26b
When opening a file, if it is using existing project, there is no nee…
sheetalkamat ae33ae8
Restructure updating the configured project from disk and actual proj…
sheetalkamat 75698a8
Add project roots in the list of root files even if they arent presen…
sheetalkamat f154910
Move the server file system to handle watches on file/folder create, …
sheetalkamat 0e44367
Remove the functions to trigger watch callbacks now that it is auto o…
sheetalkamat 2a63827
Update the todo list
sheetalkamat 96ffd53
Reload the configured project only once even though there are multipl…
sheetalkamat 6bd42b8
When config file is deleted, apart from removing the projecty, reload…
sheetalkamat df6f75b
Optimize wildcard watchers and config directory watching as now we ha…
sheetalkamat 9ff9476
Handle the deleted file in update graph better, so that in next updat…
sheetalkamat 62871cc
Only update file list when there are changes in the watched directories
sheetalkamat 48c6513
Update types instantly when the type root changes.
sheetalkamat 19a6a00
Cache the read directory results so that it doesnt end up reading it …
sheetalkamat 68def1b
Use the cached file exists/directory exists for configured project si…
sheetalkamat 029b1f2
Fixes the fourslash runner tests by handling hosts that cannot suppor…
sheetalkamat f338a70
Remove the done TODO
sheetalkamat 8fedcf7
TODOs for the scheduling update graph and referesh projects
sheetalkamat e568976
Allows the delayed update graph and project structure which helps in …
sheetalkamat 048e67c
Merge branch 'master' into watchImprovements
sheetalkamat 0365901
use single instance of getCanonicalFileName
sheetalkamat 404aa8f
Logging of the watch add/remove/event
sheetalkamat 71d79c6
Some refactoring to combine files removal from inferred project
sheetalkamat f12980d
Remove the duplcate error about no input files found
sheetalkamat 00011a5
Refactor root files addition/update for non inferred project
sheetalkamat 0572b15
Instead of watching directories, watch tsconfig files of inferred pro…
sheetalkamat 62663a1
Use map for configured project instead of the array
sheetalkamat dcbd7b1
Combine the logic to find config file as well as the watch.
sheetalkamat 62ef6b1
Added another todo as now we are watching too many files
sheetalkamat 2439e7a
Reduce the number of watched config files by watching the chain only …
sheetalkamat ff34a77
Merge branch 'master' into watchImprovements
sheetalkamat 1155c37
Merge branch 'master' into watchImprovements
sheetalkamat ae87838
Merge branch 'master' into watchImprovements
sheetalkamat 802e283
Refactoring of the builder
sheetalkamat 499fabc
Do not update graph in builder if compile on save is not on
sheetalkamat 273569f
Make the host cache store the fileName instead of undefined for the m…
sheetalkamat 94a589b
Program cannot be reused if the missing file is now present
sheetalkamat ef5935b
Initial refactoring so that watch from tsc follows the tsserver projects
sheetalkamat e068475
Refactor so that builder handles only source files and program
sheetalkamat 6237b22
Move the builder to compiler directory
sheetalkamat 9b18f7b
Use builder to emit the files from the tsc.js
sheetalkamat 85b9254
Refactor out the tsc logic into another file so we can use that to te…
sheetalkamat 69e5abd
Refactor watched system from tsserver tests so that tscLib watch can …
sheetalkamat c814d8e
Add tests for the tsc --watch
sheetalkamat 2dd6aed
Emit tests
sheetalkamat 89c61e7
Modify the api in builder so that it tracks changed files
sheetalkamat bb91b32
Add tests to verify emitted files
sheetalkamat 46e3d1c
Refactoring so that instead of just using from tsc --watch the new ap…
sheetalkamat 031a637
Switch back to have tsc.ts the only file thats different in tsc.js ge…
sheetalkamat 0d5e6c9
Use cache for module resolution even in watch mode
sheetalkamat 2762232
Test for the module resolution caching
sheetalkamat 65a6ee0
Add test that fails because we dont watch module resolutions failed p…
sheetalkamat d55150c
Implementation of watching the failed lookup locations
sheetalkamat 8dc6248
Partial implementation for invalidating the program (instead of sourc…
sheetalkamat 7474ba7
Implementation for invalidating source file containing possibly chang…
sheetalkamat 6385f7e
Get semantic diagnostics for the program from builder so that it cach…
sheetalkamat 65521bc
Feedback from the PR
sheetalkamat 27988bf
More updates based on PR feedback
sheetalkamat 02b8a7d
More work on PR feedback
sheetalkamat f723beb
More updates per PR feedback
sheetalkamat b071a86
More work on feedback from PR
sheetalkamat 8db05c2
More work on PR feedback update
sheetalkamat 594482d
Merge branch 'master' into watchImprovements
sheetalkamat d0a23bb
Merge branch 'watchImprovements' into builder
sheetalkamat 59d07dc
Simplified mutate map options
sheetalkamat 9895082
Updating according to feedback from PR
sheetalkamat f1b1b12
More work based on feedback
sheetalkamat 136b091
Update based on feedback
sheetalkamat 6bf9133
Update to PR feedback
sheetalkamat a99c04e
Make the failedLookuplocations to be readonly array
sheetalkamat b66b752
Update based on feedback
sheetalkamat da0d374
Made updates to not expose methods/types that arent needed.
sheetalkamat e639ceb
Merge branch 'watchImprovements' into builder
sheetalkamat 8deef58
Remove the unused function from the Project since builder has this lo…
sheetalkamat c425128
When getting default project from session, get it only if the script …
sheetalkamat d217bec
Merge branch 'master' into watchImprovements
sheetalkamat 60e2e68
Merge branch 'watchImprovements' into builder
sheetalkamat 84b2e23
More PR feedback work
sheetalkamat 3908325
Merge branch 'watchImprovements' into builder
sheetalkamat 7173da2
Adding test for #16329 to verify the caching of file system when open…
sheetalkamat e500be2
Adding test for #16456 to verify watched directories in case-sensitiv…
sheetalkamat 6227a36
In Server when polling the file stat's do not send changed event in c…
sheetalkamat 55931c4
Update the failed lookup watches without doing lookups.
sheetalkamat e65df12
Add test for #16955 which simulates npm install
sheetalkamat e711238
Add api in builder to get changed files and use it to send project ch…
sheetalkamat 3b85f3f
Add tests to verify project changed event sent
sheetalkamat ea95f3b
Merge pull request #17820 from Microsoft/tsserverEventChangedFiles
sheetalkamat 9e570c3
Merge pull request #17669 from Microsoft/builder
sheetalkamat 4c79033
Refactoring to watches and caching of system such that we minimize fu…
sheetalkamat 5aafd3f
Reduce number of watches for failed lookup locations as part of modul…
sheetalkamat 17565d8
Handle watches of missing directories and make project the module res…
sheetalkamat 10ea5bf
Script infos while opening/closing shouldnt mark project as dirty if …
sheetalkamat 254e393
Watch failed lookups recursively to reduce number of directory watches
sheetalkamat a3b9467
Resolve only once in the given directory for name
sheetalkamat 16cf7c4
Watch for the automatic types that included as part of type resolution
sheetalkamat d7ce95d
Watch node_modules if possible
sheetalkamat 345f36d
Update tests
sheetalkamat 2b97b2c
Print number of files in the project when printing project
sheetalkamat 8d5d4c2
Reduce storage of maps/sets for failed lookups
sheetalkamat 9e5e20c
Remove the configured project if on next open file if it has no open …
sheetalkamat 13aafa2
Update tests
sheetalkamat 6c61293
Test to verify calls to isProgramUptoDate return true when there is n…
sheetalkamat 7b2bab5
Revert to use refcount to keep track of directory watchers for failed…
sheetalkamat 54f64a1
Resolution is valid unless it is invalidated
sheetalkamat 0ff160f
Add files to change set instead of delay reloading project on "change…
sheetalkamat e6eede1
Update how we get project/script info so that it doesnt start unneces…
sheetalkamat 2a5d954
Reduce the file size for npm install test
sheetalkamat 680994e
Better log for update graph and delay operations
sheetalkamat c8e711c
Invalidate resolution of the failed lookup only if its one of the def…
sheetalkamat 29e93c3
Update the test cases for project changed event since it doesnt apply…
sheetalkamat b179cd1
Return configured project being closed by config file
sheetalkamat 67f9533
Limit the resolution invalidation to max number of files as invalidat…
sheetalkamat de28d02
Add test case to verify correct resolution file is picked when curren…
sheetalkamat 5739b68
Do not create map just to store empty reference files. Also update fi…
sheetalkamat fdb104b
Merge branch 'master' into watchImprovements
sheetalkamat aea8630
Merge branch 'master' into watchImprovements
sheetalkamat b536f9d
Should not remove the reused resolutions in the file when file conten…
sheetalkamat 4f7c0e5
Simplify event sent on background project update since its anyways ju…
sheetalkamat cf72f2a
Merge branch 'master' into watchImprovements
sheetalkamat 23acff5
Merge branch 'master' into watchImprovements
sheetalkamat 14febe2
Rename watchedProgram.ts to watch.ts
sheetalkamat 38f3a2b
Renamed PartialSystem as DirectoryStructureHost and CachedPartialSyst…
sheetalkamat 68d3605
PR feedback
sheetalkamat 9e08cae
Merge branch 'master' into watchImprovements
sheetalkamat 835153b
PR feedback
sheetalkamat 898559b
Merge branch 'master' into watchImprovements
sheetalkamat 7f969e8
Making APIs as internal so that we can enable them after we have figu…
sheetalkamat 4bb4711
Merge branch 'master' into watchImprovements
sheetalkamat 8ac01d7
Separate namespace declarations in builder of intenal and exported in…
sheetalkamat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 likely a minor slow-down, for no benefit to readability.
Functions that are called with polymorphic arguments are quickly de-optimised. This one is specifically intended to be called with polymorphic arguments, so it's very likely to be de-optimised and become slower than conventional idiomatic
typeof === 'string'
.Worth checking with a timed run.