Skip to content

Conversation

dario-piotrowicz
Copy link
Member

This PR moves the repl completion logic into its own internal module, my reasoning for proposing this change is that the repl completion logic currently occupies a big chunk of the repl module and it's hard to tell which functions are relevant to it and which are not.

So, also given the fact that the completion logic is pretty self contained, I believe that isolating it will lead to a better, more maintainable and more understandable code structure.

This is also consistent with the repl history which has its own internal module (and also the await module).

Later I am also planning to do other code restructuring/cleanups, but for this PR, in order to make it easy to review I tried to minimize as much as possible code changes and just tried to move things over the new internal completion module. So in this PR I basically only moved code from lib/repl.js to lib/internal/repl/completion.js, with the only exception being that I moved shared logic into the lib/internal/repl/utils.js (and imported it in the other 2 modules).

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. repl Issues and PRs related to the REPL subsystem. labels Sep 14, 2025
@dario-piotrowicz dario-piotrowicz force-pushed the dario/repl-completion branch 3 times, most recently from d7a2677 to 0db4da2 Compare September 14, 2025 23:48
Copy link

codecov bot commented Sep 15, 2025

Codecov Report

❌ Patch coverage is 95.14451% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.30%. Comparing base (c8c6bfa) to head (446cedc).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/repl/completion.js 94.76% 38 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #59889      +/-   ##
==========================================
+ Coverage   88.29%   88.30%   +0.01%     
==========================================
  Files         702      703       +1     
  Lines      206875   206954      +79     
  Branches    39806    39812       +6     
==========================================
+ Hits       182667   182760      +93     
+ Misses      16218    16206      -12     
+ Partials     7990     7988       -2     
Files with missing lines Coverage Δ
lib/internal/repl/utils.js 96.67% <100.00%> (+0.19%) ⬆️
lib/repl.js 94.12% <100.00%> (-0.15%) ⬇️
lib/internal/repl/completion.js 94.76% <94.76%> (ø)

... and 26 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.

@dario-piotrowicz dario-piotrowicz 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 Sep 15, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 16, 2025
@nodejs-github-bot
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. needs-ci PRs that need a full CI run. repl Issues and PRs related to the REPL subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants