Skip to content
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

Allow multi-line REPL prompts like node #3

Closed
blakeembrey opened this issue Jul 15, 2015 · 5 comments
Closed

Allow multi-line REPL prompts like node #3

blakeembrey opened this issue Jul 15, 2015 · 5 comments
Assignees

Comments

@blakeembrey
Copy link
Member

Node appears to handle this by detecting syntax errors. I can probably catch compilation errors and check the error codes are syntax errors too and recover from that.

Relevant: https://github.com/joyent/node/blob/d13d7f74d794340ac5e126cfb4ce507fe0f803d5/lib/repl.js#L125-L129

@Igorbek
Copy link

Igorbek commented Apr 16, 2016

@blakeembrey hey, do you have any update on this?

@blakeembrey
Copy link
Member Author

See the linked issue in node.

@robey
Copy link

robey commented Sep 26, 2016

Looks like this still exists in ts 2.0.

@blakeembrey
Copy link
Member Author

Yes, it's unrelated to TypeScript. There's nodejs/node#6171 still pending to support this.

@blakeembrey
Copy link
Member Author

blakeembrey commented Oct 15, 2016

Ok, I've implemented basic support for recoverable errors. There may be edge cases until nodejs/node#6171 lands, but I've manually coded the recoverable TypeScript diagnostic codes into https://github.com/TypeStrong/ts-node/blob/master/src/_bin.ts#L362-L369 for now. If you find something that you think should work, let me know and it can be added to the list.

Edit: Remember, this'll only work on node 6+ as that's when the recoverable error export landed.

kumarashwin added a commit to kumarashwin/ts-node that referenced this issue Jun 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants