Skip to content

Keep resolvedExternalEditor and selectedExternalEditor in sync - #8387

Merged
outofambit merged 8 commits into
developmentfrom
ku-always-resolve-upon-setting-external-editor
Oct 16, 2019
Merged

outofambit merged 8 commits into
developmentfrom
ku-always-resolve-upon-setting-external-editor

Conversation

@kuychaco

@kuychaco kuychaco commented Oct 2, 2019

Copy link
Copy Markdown
Contributor

Overview

Follow up for #8380

Description

This PR expands upon #8380, extracting a method called updateSelectedExternalEditor to ensure that we update the resolvedExternalEditor after updating the selectedExternalEditor. By using this method, we can more easily guard against the two drifting out of sync, as they did in #8322.

Release notes

Notes: no-notes

/ cc @niik @outofambit @billygriffin

This might be just me, but when I think `get` I imagine a simple getter that looks up and returns a value. Whereas this function is a bit more complex -- it looks in local storage and then looks up available editors per platform, checking the cache first. The term `lookup` may not be the bet either, but it's the best I can think of.

I also wanted to do this because I am going to create an `updateSelectedExternalEditor` method, and it'd be weird to have `updateSelectedExternalEditor(this.getSelectedExternalEditor)`
…setting new value

To ensure we avoid issues like #8322
In 86afd86 the logic to resolve the editor was moved to a different method and now it is no longer immediately after the tutorial assessor initialization
…t is

Prior to this change, if the user uninstalled the editor they'd selected then we'd throw an error and would fail to resolve the current editor at startup
@kuychaco kuychaco added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Oct 4, 2019
@outofambit
outofambit self-requested a review October 15, 2019 17:15
outofambit
outofambit previously approved these changes Oct 15, 2019

@outofambit outofambit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm!

@outofambit outofambit self-assigned this Oct 15, 2019
…is-installed

Ensure editor from local storage is actually installed
@outofambit
outofambit merged commit 31c033e into development Oct 16, 2019
@outofambit
outofambit deleted the ku-always-resolve-upon-setting-external-editor branch October 16, 2019 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants