-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Support repl multiline input #1165
Conversation
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.
LGTM - I suspect we'll have to go through several revisions of this.
Yeah we definitely need to improve this later. This solution currently has problems like
it won't check if Maybe we could for now differentiate |
I would just have a look at how node does this... |
- Update to TypeScript 3.1.6 (denoland#1177) - Fixes Headers type not available. (denoland#1175) - Reader/Writer to use Uint8Array not ArrayBufferView (denoland#1171) - Fixes importing modules starting with 'http'. (denoland#1167) - build: Use target/ instead of out/ (denoland#1153) - Support repl multiline input (denoland#1165)
@hayd Actually your intuition is correct. Node does the following: // If error was SyntaxError and not JSON.parse error
if (e) {
if (e instanceof Recoverable && !sawCtrlD) {
// Start buffering data like that:
// {
// ... x: 1
// ... }
self[kBufferedCommandSymbol] += cmd + '\n';
self.displayPrompt();
return;
} else {
self._domain.emit('error', e.err || e);
}
} Also we might want to implement something similar to Node's Should we implement stuff like |
I think we can wait on some compiler improvements (to compile ts) by |
This works,
but I had to comment out the setTimeout test, maybe due to #1161.Note: It's not interactive over multiple lines (only the last line is editable).