Uh oh!
There was an error while loading. Please reload this page.
repl: support syntax highlighting - #53571
Conversation
avivkeller
commented
Jun 24, 2024
CC @nodejs/repl |
ZYSzys
commented
Jun 25, 2024
Could you add some tests ? |
Tests have been added @ZYSzys, sorry I forgot to let you know when I pushed the commits. The failed tests appear unrelated. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
avivkeller
commented
Jul 10, 2024
(got review - removing label) |
avivkeller
commented
Jul 11, 2024
All review conversations have been resolved, any more notes? |
BridgeAR
commented
Jul 11, 2024
@redyetidev do you have some screenshots or a short video of the usage? I am not certain in what way the syntax highlighting has changed :) |
@BridgeAR highlighting is done to input, and it follows (mostly) the same rules as NewOldI'm not sure if this is |
MoLow
commented
Jul 14, 2024
I think both :) |
The
notable-change Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section. |
@MoLow ive added both labels. |
avivkeller
commented
Jul 15, 2024
All checks have passed, but I assume this needs a CI to land. If someone could review, approve, and CI, it would be appreciated. Thanks :-)! |
atlowChemi
left a comment
There was a problem hiding this comment.
The PR currently only tests the new internal/repl/highlight module, but I think tests should be aded to ensure the input is colored in REPL as well.
The |
atlowChemi
commented
Jul 17, 2024
I'd look at test like |
nodejs-github-bot
commented
Aug 7, 2024
I'm a little concerned about the failure at https://ci.nodejs.org/job/node-test-commit-linux-containered/nodes=ubuntu2204_sharedlibs_withoutssl_x64/45088/testReport/junit/(root)/parallel/test_repl_preview_without_inspector/, but it didn't seem to fail anywhere else 🤔 I've removed author ready, because I don't think this should land until that is resolved. Feel free to re add the label if you disagree. |
avivkeller
commented
Aug 8, 2024
Fixed the issue, readded the label. |
This comment was marked as outdated.
This comment was marked as outdated.
avivkeller
commented
Aug 13, 2024
The failed CI is unrelated. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
avivkeller
commented
Sep 2, 2024
https://ci.nodejs.org/job/node-test-commit-linux-containered/45732/ is failing, and that concerns me that this API is adding to many control sequences, and it'll clutter developers trying to simply parse the output. I'm wondering if this should be closed for now, until a time where it can be implemented with less control sequencnes? |
| input: " { b: 1 }['b'] === 1", | ||
| preview: [ | ||
| " { b: 1 }['b'] === 1\r", | ||
| "\x1B[1G\x1B[0Jrepl > \x1B[9G\x1B[1G\x1B[0Jrepl > {\x1B[10G\x1B[1G\x1B[0Jrepl > { \x1B[11G\x1B[1G\x1B[0Jrepl > { b\x1B[12G\x1B[1G\x1B[0Jrepl > { b\x1B[36m:\x1B[39m\x1B[12G\x1B[1G\x1B[0Jrepl > { b\x1B[36m:\x1B[39m \x1B[13G\x1B[1G\x1B[0Jrepl > { b\x1B[36m:\x1B[39m \x1B[33m1\x1B[39m\x1B[12G\x1B[1G\x1B[0Jrepl > { b\x1B[36m:\x1B[39m \x1B[33m1\x1B[39m \x1B[12G\x1B[1G\x1B[0Jrepl > { b\x1B[36m:\x1B[39m \x1B[33m1\x1B[39m }\x1B[12G\x1B[1G\x1B[0Jrepl > { b\x1B[36m:\x1B[39m \x1B[33m1\x1B[39m }[\x1B[13G\x1B[1G\x1B[0Jrepl > { b\x1B[36m:\x1B[39m \x1B[33m1\x1B[39m }[\x1B[32m'\x1B[39m\x1B[13G\x1B[1G\x1B[0Jrepl > { b\x1B[36m:\x1B[39m \x1B[33m1\x1B[39m }[\x1B[32m'b\x1B[39m\x1B[14G\x1B[1G\x1B[0Jrepl > { b\x1B[36m:\x1B[39m \x1B[33m1\x1B[39m }[\x1B[32m'b'\x1B[39m\x1B[13G\x1B[1G\x1B[0Jrepl > { b\x1B[36m:\x1B[39m \x1B[33m1\x1B[39m }[\x1B[32m'b'\x1B[39m]\x1B[13G\x1B[1G\x1B[0Jrepl > { b\x1B[36m:\x1B[39m \x1B[33m1\x1B[39m }[\x1B[32m'b'\x1B[39m] \x1B[13G\x1B[1G\x1B[0Jrepl > { b\x1B[36m:\x1B[39m \x1B[33m1\x1B[39m }[\x1B[32m'b'\x1B[39m] \x1B[36m=\x1B[39m\x1B[14G\x1B[1G\x1B[0Jrepl > { b\x1B[36m:\x1B[39m \x1B[33m1\x1B[39m }[\x1B[32m'b'\x1B[39m] \x1B[36m==\x1B[39m\x1B[14G\x1B[1G\x1B[0Jrepl > { b\x1B[36m:\x1B[39m \x1B[33m1\x1B[39m }[\x1B[32m'b'\x1B[39m] \x1B[36m===\x1B[39m\x1B[15G\x1B[1G\x1B[0Jrepl > { b\x1B[36m:\x1B[39m \x1B[33m1\x1B[39m }[\x1B[32m'b'\x1B[39m] \x1B[36m===\x1B[39m \x1B[14G\x1B[1G\x1B[0Jrepl > { b\x1B[36m:\x1B[39m \x1B[33m1\x1B[39m }[\x1B[32m'b'\x1B[39m] \x1B[36m===\x1B[39m \x1B[33m1\x1B[39m\x1B[14G\r", |
avivkeller
commented
Sep 21, 2024
I no longer think this is a good idea. See the comment above. |
atlowChemi
commented
Sep 21, 2024
If that would be an issue, the |
avivkeller
commented
Sep 21, 2024
If you say so, I trust your opinion. I'll keep this open in that case, though I have my reservations. |
avivkeller
commented
Oct 27, 2024
Hey y'all, I don't have the time to persue this feature, given the other Node.js-related things I am working on. I'm closing this PR, but I'm happy for someone to continue the work. |


Instead of sending many REPL changes in one PR (#52965), it was recommended to me to implement these one-by-one in several PRs.
First up: Syntax highlighting 🎉
This PR adds RegEx-based syntax highlighting to the REPL.
Notable change text (if text this short is even worth it): "The REPL now includes syntax highlighting for input."