-
Notifications
You must be signed in to change notification settings - Fork 33
Promise-ify nreplClient.ts. #49
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
Conversation
Thank you very much for your work @mhansen! |
Sorry, I'm new and I think I'm probably missing something - how do I check your review? I don't see any comments on the diffs here: https://github.com/avli/clojureVSCode/pull/49/files?diff=split. Is there a trick to show review comments? |
Ah, I see what you mean: I left some comments on your pull request #50. Looks good! |
src/nreplClient.ts
Outdated
const stacktrace = (session: string): Promise<any> => send({ op: 'stacktrace', session: session }); | ||
const stacktrace = (session: string): Promise<any> => { | ||
return send({ op: 'stacktrace', session: session }); | ||
} |
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.
Is there any reason to chance this @mhansen?
Because they mean exactly the same.
Do you think it's easier to read or something like that?
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 just changed it to be consistent with the other lines in this file, where a bunch of the other send functions have the body of the function in a block on a new line.
But I don't feel strongly about this change at all. Actually, looking back on the original state, it seems like there is some consistency that I missed in the first place - that if it's an easy one-liner, it's done as a one-liner style, but if it wouldn't fit on one line, it's done on two lines. So maybe this was unnecessary :-)
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.
That's ok. =) It's up to you (and @avli). I'll trust whatever you think it's best then.
If you think the old way was better, just commit those changes back. If not, that's fine as well.
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.
Reverted these bits.
Convert a few callers who had to wrap the callbacks in Promises to use the .then() Promise-transforming APIs instead. Removed a duplicate definition of 'document' in clojureSuggest.ts which was flagged as a warning after this refactoring.
9c864b4
to
75ac00c
Compare
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.
Great work imo. Thank you @mhansen.
Great job indeed, guys. Thank you very much! |
Convert a few callers who had to wrap the callbacks in Promises to use the .then() Promise-transforming APIs instead.
Removed a duplicate definition of 'document' in clojureSuggest.ts which was flagged as a warning after this refactoring.