-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
feat(cli/repl): add regex based syntax highlighter #7811
feat(cli/repl): add regex based syntax highlighter #7811
Conversation
This adds a simple regex replace based highlighter to the repl editor.
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.
Looks great @caspervonb, slating for 1.5.0
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, thank you @caspervonb for this feature, it's extremely useful. I also like how simple the implementation is.
I'd be great to have a way to test that, but it's the same problem as with all integration tests.
(?P<boolean>\b(?:true|false)\b) | | ||
(?P<null>\b(?:null)\b) | | ||
(?P<undefined>\b(?:undefined)\b) | | ||
(?P<keyword>\b(?:await|async|var|let|for|if|else|in|of|class|const|function|yield|return|with|case|break|switch|import|export|new|while|do|throw|catch)\b) | |
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.
missing this
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.
Indeed, treating it as identifier (no color) for now.
This adds a simple regex replace based highlighter to the repl editor.
Overall it tries to match the color palette of
Deno.inspect
.Closes #1928