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

Make REPL prompt reflect current NS reliably #340

Merged
merged 2 commits into from
Sep 24, 2019

Conversation

cfehse
Copy link
Contributor

@cfehse cfehse commented Sep 23, 2019

If an evaluation changes the namespace the change is populated back to the REPL window.

This pull request:

Fixes #280.

Introduces the following change(s):

  • CANGELOG.md as requested
  • calva/repl-window.ts REPLWindow.replEval() method to populate a namespace change from the evaluation back to the repl window.

(If you have considered alternative ways to introduce the change, replace this paragrah with a brief reasoning about why you made the choices you did. Otherwise just remove this paragraph.)

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.)
  • Referenced the issue I am fixing/addressing.
    • If I am fixing the issue, I have used GitHub's fixes/closes syntax
    • If I am fixing just part of the issue, I have just referenced it w/o any of the "fixes” keywords.
  • Created the issue I am fixing/addressing, if it was not present.
  • Updated the [Unrleased] entry in CHANGELOG.md, linking the issue(s) that the PR is addressing.

Ping: @PEZ, @kstehn

If an evaluation changes the namespace the change is populated back.
@PEZ PEZ changed the title This fixes issue #280 Make REPL prompt reflect current NS reliably Sep 23, 2019
CHANGELOG.md Outdated
@@ -5,6 +5,7 @@ Changes to Calva.
- [Support for custom project/workflow commands](https://github.com/BetterThanTomorrow/calva/issues/281)

## [Unreleased]
- [REPL ns prompt does not change with (ns ..) form](https://github.com/BetterThanTomorrow/calva/issues/280)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should reflect what has happened with the change. So either something like what I renamed the PR to, or simply add the word ”Fix” in the beginning.

@@ -169,6 +169,10 @@ class REPLWindow {
})
try {
this.postMessage({ type: "repl-response", value: await this.evaluation.value, ns: this.ns = ns || this.evaluation.ns || this.ns });
if(this.evaluation.ns && this.ns != this.evaluation.ns) {
// the evaluation changed the namespace so set the new namespace.
this.setNamespace(this.evaluation.ns);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Awesome. I have been figuring about this a bit, but obviously not enough to figure this fix out. Thanks!

@PEZ
Copy link
Collaborator

PEZ commented Sep 23, 2019

Sweeet!

@PEZ
Copy link
Collaborator

PEZ commented Sep 23, 2019

This works like a charm. It's a bit late here, so I will merge tomorrow, when I am a bit less stupidly tired. 😄

@PEZ PEZ merged commit a87ec08 into BetterThanTomorrow:dev Sep 24, 2019
@PEZ
Copy link
Collaborator

PEZ commented Sep 24, 2019

Among fixes, this one is one of the nicest. It has bothered me a lot that I can't trust the prompt.

@cfehse cfehse deleted the fix/issue-280 branch September 25, 2019 16:31
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.

2 participants