optim(watch): don't reset DocumentRegistry
b/t watch cycles
#388
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.
Summary
Keep the
DocumentRegistry
b/t watch cycles instead of resetting it3.
specificallyDetails
options
hookPotential Further Optimizations
DocumentRegistry
can actually be shared between multiple LSes for Recommendation for multi-module setup? Memory leak with 18+ Rollup watchers #177. Per the TS LS Wiki, sharingDocumentRegistry
is actually recommended, as, minimally,lib.d.ts
could be shared between projects.DocumentRegistry
as a top-level var, before the plugin is instantiated... that would makeDocumentRegistry
shared between all imports of rpt2... but it would still be limited to only the same Node process... so guess that's probably not useful either in this case 😕tsModule
isn't set till plugin instantiation (as visible in this PR, where theDocumentRegistry
is only instantiated aftertsModule
is set)...parsedConfig
hasn't changed between watch cycles, which is probably the most common usage of watch anyway, i.e. changing source files and not config