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.
Closes #925
Notes
I have also left some TODOs in a few places as I believe we can further reduce the amount of events sent, but I didn't want to do it all in one PR.
This already reduces notifications for a simple root module w/ 1 submodule from 54 (18
workspace/semanticTokens/refresh
+ 18client.refreshModuleCalls
+ 18client.refreshModuleProviders
) down to 3, assuming all operations finish within 1 second or earlier.How? A new
notifier
package along with amodule_changes
memdb table is responsible for batching module changes. The "barrier" for releasing a batch is either elapsed 1 second from the first change or no queued/running jobs involving the module (whatever comes first).Data Flow
For simplicity, diagrams only represent semantic token refreshing, but in reality there's 4 more event types which would each potentially result in similar amount of refresh notifications sent.
Before
After
Log Before
https://gist.github.com/radeksimko/6d0901d6a65f79386e87a7450bfcad13#file-before-log
Log After
https://gist.github.com/radeksimko/6d0901d6a65f79386e87a7450bfcad13#file-after-log