Closed lazywithclass closed 7 years ago
Thank you for your feedback! I've fixed the behavior in https://github.com/abicky/nodejs-repl.el/commit/91b19d2e563931a150ff6ebcf60e58543e1dec9c. Please try version 0.1.3.
Hi @abicky thanks for this!
It does not work for things like
const answer = () => 41 + 1
const print = what => {
console.log(what)
return what
}
while instead it works for
const print = (what) => { // note the parens around what
console.log(what)
return what
}
But I think it's fine like this for now!
I've released version 0.1.5 and it supports the syntax of allow function as below:
const answer = () => 41 + 1 /* caret is here */ //=> 1
const answer = () => { return 41 + 1 } /* caret is here */ //=> [Function] (() => { return 41 + 1 })
const answer = () => { return 41 /* caret is here */ + 1 } //=> 41
const answer = () => { /* caret is here */ return 41 + 1 } //=> No proper expression is found backward
By the way, I've renamed nodejs-repl-send-last-sexp
to nodejs-repl-send-last-expression
and marked nodejs-repl-send-last-sexp
as deprecated.
Thanks a lot for this addition!
First of all thanks for this tool!
I am having a hard time figuring out how to use
nodejs-repl-send-last-sexp
, for example if I run it on the following:then this is evaluated
while I would've liked the whole thing. Is there any way to have this? One could use
nodejs-repl-send-region
, as a fallback, is that intended?I've had a look at the source code and the function responsible to figure out the extension of the sexp seems to be
backward-sexp
.