Refactor to accommodate upstream VSCode API changes#10569
Refactor to accommodate upstream VSCode API changes#10569DonJayamanne merged 3 commits intomicrosoft:ds/custom_editorfrom
Conversation
src/client/datascience/interactive-ipynb/nativeEditorProvider.ts
Outdated
Show resolved
Hide resolved
| modelPromise = storage.load(file, contents).then(m => { | ||
| if (!this.modelChangedHandlers.has(key)) { | ||
| this.modelChangedHandlers.set(key, m.changed(this.modelChanged.bind(this))); | ||
| if (!this.models.has(m)) { |
There was a problem hiding this comment.
@rchiodo Instead of using a dict that's keyed by the file, i'm using a weekmap.
Basically if we have a new model then we add event handlers.
And using a weekmap to not hold onto to the model ref.
Using a dictionary keyed with file, might not work, as its possible that the editor was closed, hence the model and the like get disposed, thus this condition will never get satisfied...
this way there's no ambiguitiy, - new model, then add event handlers.
Codecov Report
@@ Coverage Diff @@
## ds/custom_editor #10569 +/- ##
===================================================
Coverage ? 60.65%
===================================================
Files ? 579
Lines ? 31429
Branches ? 4477
===================================================
Hits ? 19062
Misses ? 11396
Partials ? 971
Continue to review full report at Codecov.
|
|
Kudos, SonarCloud Quality Gate passed!
|
* master: Fix merge issue Move redux logging to a different file (#10605) Disable custom editor API (#10604) Ensure local host only if connection not available (#10600) Delegate management of notebooks (creation and disposing) to I… (#10568) Refactor to accommodate upstream VSCode API changes (#10569) Use a single notebook beetween multiple native editors (#10514) Add support for synchronising edits between two nb editors of… (#10189) Fix tests in ds/custom_editor branch (#10512) Fix linter Reimplement custom editor using new API
For #9960