Skip to content

repl: add basic syntax highlighting - #64591

Closed
avivkeller wants to merge 4 commits into
nodejs:mainfrom
avivkeller:repl-syntax-highlighting
Closed

repl: add basic syntax highlighting#64591
avivkeller wants to merge 4 commits into
nodejs:mainfrom
avivkeller:repl-syntax-highlighting

Conversation

@avivkeller

@avivkelleravivkeller commented Jul 19, 2026

Copy link
Copy Markdown
Member

Adds basic syntax highlighting similar to our util.inspect. Highlighting is done using util.inspect.styles, so the coloring is in-tune with inspect, see below:

Screenshot 2026-07-18 at 7 37 24 PM

Notable Change: The REPL now performs syntax highlighting when useColors: true

@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. readline Issues and PRs related to the built-in readline module. repl Issues and PRs related to the REPL subsystem. labels Jul 19, 2026
Signed-off-by: avivkeller <me@aviv.sh>
@avivkeller
avivkellerforce-pushed the repl-syntax-highlighting branch from 840d437 to 1eb1502CompareJuly 19, 2026 02:44
@avivkeller

Copy link
Copy Markdown
MemberAuthor

cc @nodejs/repl

@avivkelleravivkeller added the notable-change PRs with changes that should be highlighted in changelogs. label Jul 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The notable-changePRs with changes that should be highlighted in changelogs. label has been added by @avivkeller.

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.

@codecov

codecovBot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.13084% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.15%. Comparing base (4f844f4) to head (3acc790).
⚠️ Report is 2 commits behind head on main.

Files with missing linesPatch %Lines
lib/internal/repl/highlight.js97.75%2 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #64591 +/- ##
==========================================
+ Coverage 90.13% 90.15% +0.01% 
==========================================
Files 741 742 +1 Lines 241976 242167 +191 Branches 45543 45596 +53 ==========================================
+ Hits 218116 218334 +218 + Misses 15379 15345 -34 - Partials 8481 8488 +7 
Files with missing linesCoverage Δ
lib/internal/readline/interface.js93.25% <100.00%> (+0.04%)⬆️
lib/internal/util/inspect.js96.93% <100.00%> (+<0.01%)⬆️
lib/repl.js92.93% <100.00%> (+0.01%)⬆️
lib/internal/repl/highlight.js97.75% <97.75%> (ø)

... and 36 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@avivkelleravivkeller added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Jul 20, 2026
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 20, 2026
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@avivkeller

Copy link
Copy Markdown
MemberAuthor

Bump @nodejs/repl, one more approval :-)

avivkeller added a commit that referenced this pull request Jul 26, 2026
Signed-off-by: avivkeller <me@aviv.sh>
PR-URL: #64591
Reviewed-By: James M Snell <jasnell@gmail.com>
@avivkeller

Copy link
Copy Markdown
MemberAuthor

Landed in 4a5eb1c

@aduh95aduh95 added the backport-requested-v26.x PRs awaiting manual backport to the v26.x-staging branch. label Aug 3, 2026
@aduh95

Copy link
Copy Markdown
Contributor

This doesn't land cleanly on v26.x-staging, we'd need a manual backport PR if we want it there

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.backport-requested-v26.xPRs awaiting manual backport to the v26.x-staging branch.needs-ciPRs that need a full CI run.notable-changePRs with changes that should be highlighted in changelogs.readlineIssues and PRs related to the built-in readline module.replIssues and PRs related to the REPL subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@avivkeller@nodejs-github-bot@aduh95@jasnell