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

PROPOSAL enhance REPL window handling #422

Merged
merged 102 commits into from
Oct 27, 2019
Merged

Conversation

cfehse
Copy link
Contributor

@cfehse cfehse commented Oct 23, 2019

What has Changed?

  • src/connector.ts
    • Moved code to create/show the REPL windows into a seperate function.
    • Improved error checking during the connect sequence.
  • NReplEvaluation in nrepl/index.ts
    • Enhanced the class to contain all message parsing.
    • Added properties which contain all information about the evaluation on resolve/reject.
    • Store any normal and error output of the evaluation for later use.
    • Retrieve the stacktrace of an exception before reject the promise.
    • Make sure that a running evaluation will be correctly rejected during interruption.
    • Added mechanism to interrupt all running evaluations at once.
    • Added mechanism to provide generic user input for evaluations not running in the REPL window.
  • functions eval() and loadfile() in nrepl/index.ts
    • Delegate message parsing and resolve/reject to the NReplEvaluation class to ensure both methods behave identical.
  • repl-window.ts improved reconnect sequence
    • Use the NReplEvaluation class to retrieve error output and display it in the REPL window. Unfortunately with will not show errors on the first connect with shadow-cljs because the repl needs some time to initialize completely and show the error during eval. I the REPL window is closed and reopened the error is shown on reconnect. This is maybe better than nothing. gg

calva-error-reconnect

  • Added mechanism to add history entries which will not pollute the history. Identical evaluation run many time in a row will only be added once.
  • Added commands to clear the REPL windows
    • Added a command per REPL type.
    • Clear the history of the REPL window and clear the content in the webview.
  • Add robust support for evaluation interruption (ctrl+d - see [Feature request] Allow interruption of execution #237)
  • Added support for read-line from the REPL window ( see clojure.core/read-line doesn't work in Calva REPL #377) and in the editor.
  • Added command "Interrupt running Evaluations" (ctrl+alt+c ctrl+alt+d) to interrupt all running evaluations in editors and REPL windows.
  • Made the message handling and evaluation in the REPL window completely asynchronous (removed all unnecessary async/awaits).

My Calva PR Checklist

I have:

  • Read How to Contribute.
  • Made sure I am directing this pull request at the dev branch. (Or have specific reasons to target some other branch.)
  • Made sure I am changed the default PR base branch, so that it is not master. (Sorry for the nagging.)
  • Tested the VSIX built from the PR (well, if this is a PR that changes the source code.) 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. (For now you'll need to opt in to the CircleCI New Experience UI to see the Artifacts tab, because bug.)
    • Tested the particular change
    • Figured if the change might have some side effects and tested those as well.
    • Smoke tested the extension as such.

Before merging we (at least one of us) have:

  • Made sure the PR is directed at the dev branch (unless reasons).
  • Read the source changes.
  • Given feedback and guidance on source changes, if needed. (Please consider noting extra nice stuff as well.)
  • Tested the VSIX built from the PR (well, if this is a PR that changes the source code.)
    • Tested the particular change
    • Figured if the change might have some side effects and tested those as well.
    • Smoke tested the extension as such.
  • If need be, had a chat within the team about particular changes.

Ping @PEZ, @kstehn, @cfehse

PEZ and others added 30 commits September 14, 2019 19:18
PEZ and others added 28 commits October 26, 2019 09:10
Disable repl needning commands when not connected
(To aid discovery)
Clarify that they also clear the history.
Move the REPL window command subs to the repl-window module
Added <repl#msgid> to the output strings for async output.
@PEZ PEZ merged commit c5ad36e into dev Oct 27, 2019
@PEZ PEZ deleted the wip/enhance-repl-window-handling branch October 27, 2019 11:24
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.

4 participants