Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Refactor to accommodate upstream VSCode API changes #10569

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

Merged
merged 3 commits into from
Mar 13, 2020

Conversation

DonJayamanne
Copy link

For #9960

@DonJayamanne DonJayamanne added the no-changelog No news entry required label Mar 13, 2020
@DonJayamanne DonJayamanne changed the title Refactor to accomodate upstream VSCode API changes Refactor to accommodate upstream VSCode API changes Mar 13, 2020
Copy link

@rchiodo rchiodo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

if (!modelPromise) {
const storage = this.serviceContainer.get<INotebookStorage>(INotebookStorage);
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)) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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-io
Copy link

codecov-io commented Mar 13, 2020

Codecov Report

❗ No coverage uploaded for pull request base (ds/custom_editor@c9f315f). Click here to learn what that means.
The diff coverage is 32%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##             ds/custom_editor   #10569   +/-   ##
===================================================
  Coverage                    ?   60.65%           
===================================================
  Files                       ?      579           
  Lines                       ?    31429           
  Branches                    ?     4477           
===================================================
  Hits                        ?    19062           
  Misses                      ?    11396           
  Partials                    ?      971
Impacted Files Coverage Δ
src/client/common/application/types.ts 100% <ø> (ø)
src/client/datascience/types.ts 100% <ø> (ø)
...tascience/interactive-ipynb/nativeEditorStorage.ts 48.48% <100%> (ø)
...ascience/interactive-ipynb/nativeEditorProvider.ts 52.24% <30.61%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c9f315f...7425e04. Read the comment docs.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@DonJayamanne DonJayamanne merged commit cf64598 into microsoft:ds/custom_editor Mar 13, 2020
@DonJayamanne DonJayamanne deleted the newAPIChnages branch March 13, 2020 23:27
DonJayamanne added a commit that referenced this pull request Mar 17, 2020
* 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
@lock lock bot locked as resolved and limited conversation to collaborators Mar 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
no-changelog No news entry required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants