-
Notifications
You must be signed in to change notification settings - Fork 24
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
Restart the idris compiler after every commmand if it was killed #54
Changes from all commits
e8b0e89
a0175f8
11f2edf
efbce99
c8d9b8e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,15 +9,16 @@ class IdrisIdeMode extends EventEmitter | |
buffer: '' | ||
idrisBuffers: 0 | ||
|
||
constructor: -> | ||
pathToIdris = atom.config.get("language-idris.pathToIdris") | ||
@process = spawn pathToIdris, ['--ide-mode'] | ||
@process.on 'error', @error | ||
@process.on 'exit', @exited | ||
@process.on 'close', @exited | ||
@process.on 'disconnect', @exited | ||
start: -> | ||
if (not @process?) || @process.killed | ||
pathToIdris = atom.config.get("language-idris.pathToIdris") | ||
@process = spawn pathToIdris, ['--ide-mode'] | ||
@process.on 'error', @error | ||
@process.on 'exit', @exited | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Do we test for "did we already bug them about an error?" in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, good point. Not entirely sure what would be the most elegant way to do this. I don't like the callbacks anyway There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are your feelings about moving from CoffeeScript to Idris for generating the JS? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd love to, but my Idris is not good enough to do this at the moment :) |
||
@process.on 'close', @exited | ||
@process.on 'disconnect', @exited | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like, in place of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
|
||
@process.stdout.setEncoding('utf8').on 'data', @stdout | ||
@process.stdout.setEncoding('utf8').on 'data', @stdout | ||
|
||
send: (cmd) -> | ||
Logger.logOutgoingCommand cmd | ||
|
@@ -38,13 +39,18 @@ class IdrisIdeMode extends EventEmitter | |
atom.notifications.addError e.short, detail: e.long | ||
|
||
exited: (code, signal) -> | ||
short = "The idris compiler was closed or crashed" | ||
long = | ||
if signal | ||
"It was closed with the signal: #{signal}" | ||
else | ||
"It (probably) crashed with the error code: #{code}" | ||
atom.notifications.addError short, detail: long | ||
if signal == "SIGTERM" | ||
short = "The idris compiler was closed" | ||
long = "You stopped the compiler" | ||
atom.notifications.addInfo short, detail: long | ||
else | ||
short = "The idris compiler was closed or crashed" | ||
long = | ||
if signal | ||
"It was closed with the signal: #{signal}" | ||
else | ||
"It (probably) crashed with the error code: #{code}" | ||
atom.notifications.addError short, detail: long | ||
|
||
running: -> | ||
!!@process | ||
|
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.
Will this trigger one of the process alerts to fire, or does it die without a fight?
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.
It triggers the message: It looks like the compiler was closed or crashed. What do you think? It could be good to know that it worked. Could be distracting on the other hand though. But having to kill the compiler is distracting anyway probably :D
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.
The current alerts are very dire. To confirm a successful user action, we would want it not to appear like something went wrong.
Do we report the process state in the status bar? (I'd check directly, but on my phone just now.) Being able to inspect that and see that it is now dead might be all the confirmation needed.
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 is some info in the statusbar, but I'm thinking of removing it, because I have the feeling that there is already a bit too much information there.
The new version shows if a file has been loaded in a small pane below the code. Maybe it's better to unify all the idris messages in such a pane.
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 made the message less dire. It looks like this now if you stop the compiler manually: