-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add nREPL evaluation status bar indicator #1
base: stefan/refactor-status-bars
Are you sure you want to change the base?
Add nREPL evaluation status bar indicator #1
Conversation
Yes! Intention was to break the changes up into multiple PRs for readability, but since the branch is only in my repo I didn't have a better way to do this. I don't think I have permissions to add a branch to the Calva repo, right? |
565aa75
to
e94fec0
Compare
This sounds very interesting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stefan-toubia Thanks a lot for taking time to work on this. I can see how it can be pretty useful. Just curious, was there a specific feature you wanted that this enables?
private statusTextDecorator(text): string { | ||
if(this.hasErrors) { | ||
const c = this.errors.length; | ||
text = `${text} $(alert) ${c > 1 ? c : ""}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, what's this $(alert)
do in this template literal? Or is it just a temporary placeholder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah thanks!
statusBarItems.push(new TypeStatusBar(StatusBarAlignment.Left)); | ||
statusBarItems.push(new CljsBuildStatusBar(StatusBarAlignment.Left)); | ||
statusBarItems.push(new PrettyPrintStatusBar(StatusBarAlignment.Right)); | ||
statusBarItems.push(new ConnectionStatusBarItem(StatusBarAlignment.Left)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the +Item renames
@bpringe I've enjoyed being able to contribute to a tool I use so often! The evaluation status bar is helpful feedback for while you've got the output panel or REPL window closed. Plus soon I'll add an option on error to click to output the stacktrace to the REPL window. There is another use for the evaluation status I have in mind. I was revisiting this PR for adding a symbol provider and realized that in order for this to work, the symbol provider needs to wait for evaluation to complete. This is mostly working now, PR to come after this work is finished. |
Not sure I follow. You could create a PR on Calva from this branch, right? |
@PEZ my intention was to make a PR that compares Is there a process for adding a new wip branch onto the Calva repo? Or would I be able to get permission to do so? I'm making a few more changes, but I will PR this on the Calva soon. |
What has Changed?
typeStatusBar
This is very much WIP. I re-evaluated my previous approach and saw some short comings. I think what I have here is a good start, but there is still work left to do.
Emitting events from nREPL
I added an event emitter and am emitting events from an nREPL session. Only the start and finish success/error are implemented. Maybe it would be better to manage the event emitter from inside the client, I'm not sure.
Evaluation State
Right now the evaluation events are being consumed directly by the status bar. It would make more sense to manage this in the global state, but there lacks a mechanism to push state change events from the state to the subscribers, such as status bar.
Note on state management
I did notice there is a
to-do
item related to state management:Get better control of Calva state.
For this, I can make a recommendation. This doesn't apply to all applications, but I think it would make a lot of sense in Calva to implement a Redux store. This will improve on the current implementation of the global state and reduce cross dependencies on the different components. This wouldn't need to be applied to everything, just in the truly global state. I could put together a POC in a separate PR if interested.
TODO
Fixes #
My Calva PR Checklist
I have:
dev
branch. (Or have specific reasons to target some other branch.)master
. (Sorry for the nagging.)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.)[Unreleased]
entry inCHANGELOG.md
, linking the issue(s) that the PR is addressing.The Calva Team PR Checklist:
Before merging we (at least one of us) have:
dev
branch (unless reasons).Ping @PEZ, @kstehn, @cfehse