Skip to content
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

Fix evaluate updating UI, when there is no editor active #2027

Merged
merged 1 commit into from
Jan 23, 2023

Conversation

PEZ
Copy link
Collaborator

@PEZ PEZ commented Jan 22, 2023

What has changed?

When we evaluate connect sequence afterCLJReplJackInCode provided code, we use evaluate.evaluateCodeUpdatingUI function. I don't know exactly why, but maybe it is because with UI we mean both the REPL window and the decorations in the active editor. But if there is no active editor, we run into trouble. Most commands and shortcuts for evaluating things in the active editor have when clauses that guards, but the jack-in should work regardless of active editor or not.

This code is very messy and in bad need of restructuring. With this PR I pile on to the technical debt, because I don't have a good idea about how the code should be structure. It's a tiny change, just checking that we have an editor before we go access it. All use cases that have this will continue to work as before, and use cases that don't, might start working, and if they don't, they didn't work before either.

In any case the issue exposing this problem is fixed by this.

My Calva PR Checklist

I have:

  • Read How to Contribute.
  • Directed this pull request at the dev branch. (Or have specific reasons to target some other branch.)
  • Made sure I have changed the PR base branch, so that it is not published. (Sorry for the nagging.)
  • Updated the [Unreleased] entry in CHANGELOG.md, linking the issue(s) that the PR is addressing.
  • Figured if anything about the fix warrants tests on Mac/Linux/Windows/Remote/Whatever, and either tested it there if so, or mentioned it in the PR.
  • [ ] Added to or updated docs in this branch, if appropriate
  • Tests
    • Tested the particular change
    • Figured if the change might have some side effects and tested those as well.
    • Smoke tested the extension as such.
    • Tested the VSIX built from the PR (so, after you've submitted the PR). You'll find the artifacts by clicking Show all checks in the CI section of the PR page, and then Details on the ci/circleci: build test.
  • Referenced the issue I am fixing/addressing in a commit message for the pull request.
  • Formatted all JavaScript and TypeScript code that was changed. (use the prettier extension or run npm run prettier-format)
  • Confirmed that there are no linter warnings or errors (use the eslint extension, run npm run eslint before creating your PR, or run npm run eslint-watch to eslint as you go).

Ping @PEZ, @bpringe, @corasaurus-hex, @Cyrik

@PEZ PEZ merged commit 7e10289 into dev Jan 23, 2023
@PEZ PEZ deleted the 2025-evaluate-w-no-editor branch January 23, 2023 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant