-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Initialize the project cache more selectively #2608
Conversation
|
The latest changes of this PR are not available as canary, since there are no linked |
actually, I think i have to get rid of |
This looks great and the TODO is very clear! |
@Foo-x getting back to it today! |
fe04655
to
802434f
Compare
Codecov ReportBase: 65.70% // Head: 69.15% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2608 +/- ##
==========================================
+ Coverage 65.70% 69.15% +3.44%
==========================================
Files 85 72 -13
Lines 5106 4295 -811
Branches 1631 1439 -192
==========================================
- Hits 3355 2970 -385
+ Misses 1747 1320 -427
- Partials 4 5 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
ok! now it's ready for review 🥳 now that we (re) initialize the project caches more selectively in this PR, i much feel better about multi-workspace support i also feel good about the config change events. we invalidate the init status so the project caches will lazily rebuild on one of many events |
802434f
to
3971313
Compare
73d6f68
to
9306f66
Compare
231bc45
to
e791427
Compare
Massive optimization for multi-project users! fix up tests a bit
e791427
to
62bb480
Compare
Massive optimization for multi-project users!
Warning: this changes the cache lifecycle a lot, especially after config change. Might need some fine tuning 😆
I should add lots of tests actually.
Changes
WorkspaceMessageProcessor._updateGraphQLConfig()
becomes_loadAndCacheProjectConfig(projectName: string)
, which has grown up and become more discerning and instead of re-building all project config caches, we just load the project config it needs to handle that event, of course! What a poor design of mine before.Because of this, the cache invalidation strategy on configuration and settings changes must change, and also allow project caches to lazily load as needed.
TODO:
this._isInitialized()
, should be detected per-project. otherwise one project cache that had an error initializing (we perform parsing and load files, etc) will prevent all other projects from having a cache or language features.MessageProcessor.handleDidChangeConfiguration
- perhaps re-create the cache reset behaviour using a public method forWorkspaceMessageProcessor
?package.json
change events ignored more quickly via a quick parse-and-check for the top-levelgraphql
namespace.