-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
lib: repl add .load-editor feature #14503
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
Fishrock123
left a comment
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.
Needs docs.
Should be added under https://github.com/nodejs/node/blob/master/doc/api/repl.md#commands-and-special-keys
lib/repl.js
Outdated
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.
Maybe 'Load a file and enter editor mode'?
ab13971 to
b217b78
Compare
|
Would you please update your summary to describe your PR? eg.
|
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.
any reason to have these modification? (a blank line and some spaces)
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.
because add .load-editor command need more space for fomat
> .help
.break Sometimes you get stuck, this gets you out
.clear Break, and also clear the local context
.editor Enter editor mode
.exit Exit the repl
.help Print this help message
.load Load JS from a file into the REPL session
.load-editor Load a file and enter editor mode
.save Save all evaluated commands in this REPL session to a file
.say1 help for say1
.say2
>
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.
👌
Trott
left a comment
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.
Thanks for this! It would seem that it needs a test.
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.
How about this blank line?
97dc9c9 to
6137b22
Compare
|
@Fishrock123 I updated doc |
doc/api/repl.md
Outdated
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 would be helpful to have an example
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.
Do you mean add an example in doc?
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.
Yeah. For instance, I presume there's a way of providing the file name to load but that's not captured here
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 how .load does it should be fine, the second line.
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.
Thanks, I have updated doc file
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.
stream.write = common.mustNotCall('writing not allowed');
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.
thank you for your help
Fishrock123
left a comment
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.
|
In #14861 (comment) I discovered that |
|
@lance |
|
@robbinhan I see your point. But it seems to me that, as-is, As I said in my PR, I didn't mean to encroach on what you were doing here, I was just trying to address #14022. I wasn't aware of your PR until a comment from @Fishrock123. I definitely appreciate your contribution here, and I am willing to go with whatever approach makes the most sense. In this case, I feel it's fixing |
|
@lance So, does improve |
|
@robbinhan in my opinion, yes. But I want to hear from other @nodejs/collaborators on it. |
|
I'm thinking that the other PR is likely the better option. Not quite ready to sign off on it tho. |
|
I looked at both of these and I am definitely in favor of #14861. As @lance already pointed out it is more like a bug fix instead of adding a new feature. @robbinhan I appreciate your work a lot nevertheless! |
|
Closing due to the already mentioned reasons. |
support input
.load-editorin repl