Uh oh!
There was an error while loading. Please reload this page.
repl: add syntax highlighting, auto-indentation, and signature hints - #64443
repl: add syntax highlighting, auto-indentation, and signature hints#64443hemanth wants to merge 1 commit into
Conversation
nodejs-github-bot
commented
Jul 12, 2026
Review requested:
|
30413de to
14baff1CompareCodecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #64443 +/- ##
==========================================
- Coverage 90.23% 90.20% -0.03%
==========================================
Files 741 741 Lines 241375 242165 +790 Branches 45483 45628 +145 ==========================================
+ Hits 217800 218454 +654 - Misses 15129 15247 +118 - Partials 8446 8464 +18
🚀 New features to boost your workflow:
|
16ee02c to
b749718Comparehemanth
commented
Jul 12, 2026
@avivkeller for sure! having some challenges on my local machine, so depending on the GH CI to report me the build time errors. |
1e7bcec to
088a905Compareedsadr
commented
Jul 13, 2026
this one has been in my list forever; I thik this should dogfood |
hemanth
commented
Jul 13, 2026
Agree. |
088a905 to
eec5763CompareUh oh!
There was an error while loading. Please reload this page.
avivkeller
commented
Jul 14, 2026
Also note that #64034 makes some behind-the-scenes improvements as well, and may conflict with these idiomatic PRs code-wise |
ea23882 to
192fcb1CompareSigned-off-by: hemanth <hemanth.hm@gmail.com>
192fcb1 to
a7bf2beComparehemanth
commented
Jul 18, 2026
Rebased on main, removed the Highlighting, auto-indent, and signature hints are all display-only ( Adapted to the new |
avivkeller
left a comment
There was a problem hiding this comment.
As I said previously, I think these should be idiomatic PRs
hemanth
commented
Jul 19, 2026
Split into idiomatic single-feature PRs per @avivkeller's review:
Closing this monolith PR in favor of the above. |
Description
Add REPL enhancements enabled by default:
1. Inline Syntax Highlighting
Uses the Acorn tokenizer (already in
deps/) to colorize JavaScript input in real-time:const,function,if, etc.) → MagentaHighlighting is applied at display time only —
repl.lineremains plain text, so cursor positioning and evaluation are unaffected.2. Auto-Indentation
Automatically inserts 2-space indentation on continuation lines based on brace/bracket/paren depth when entering multiline input.
3. Function Signature Hints
When the user types
functionName(, the function's parameter list is displayed as a dimmed hint below the input line. Uses the V8 Inspector protocol withthrowOnSideEffect: truefor safety.Usage
These features are enabled by default when
useColorsandterminalaretrue. Individual features can be controlled viarepl.start()options (e.g.,syntaxHighlighting: false).Motivation
This addresses the feature requests from #48164, which was closed as not planned. These are quality-of-life improvements that bring the Node.js REPL closer to modern shell experiences (Python's IPython, Ruby's Pry, etc.).
Refs: #48164