Skip to content

repl: improve tab completion on computed properties #58775

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dario-piotrowicz
Copy link
Member

@dario-piotrowicz dario-piotrowicz commented Jun 21, 2025

improve the tab completion capabilities around computed properties by replacing the use of brittle and error prone Regex checks with more robust AST based analysis


Followup from #58709

@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 Jun 21, 2025
Comment on lines -1483 to -1492
// Handle variable member lookup.
// We support simple chained expressions like the following (no function
// calls, etc.). That is for simplicity and also because we *eval* that
// leading expression so for safety (see WARNING above) don't want to
// eval function calls.
//
// foo.bar<|> # completions for 'foo' with filter 'bar'
// spam.eggs.<|> # completions for 'spam.eggs' with filter ''
// foo<|> # all scope vars with filter 'foo'
// foo.<|> # completions for 'foo' with filter ''
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I'm removing this comment since I think that it is inaccurate (and as a consequence misleading), since various type of lines pass through here, like for example { a: true }

I think/hope that the code structure makes it clear enough what this else if block is for (I also have half a mind to do some refactoring to also make things clearer later on 🤔)

@dario-piotrowicz dario-piotrowicz force-pushed the dario/improve-tab-completion-on-computed-props branch from b502583 to fdfdac0 Compare June 21, 2025 12:20
improve the tab completion capabilities around computed properties
by replacing the use of brittle and error prone Regex checks with
more robust AST based analysis
@dario-piotrowicz dario-piotrowicz force-pushed the dario/improve-tab-completion-on-computed-props branch from fdfdac0 to 1398800 Compare June 21, 2025 12:23
Copy link

codecov bot commented Jun 21, 2025

Codecov Report

Attention: Patch coverage is 89.10891% with 11 lines in your changes missing coverage. Please review.

Project coverage is 90.09%. Comparing base (c3b9868) to head (1398800).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
lib/repl.js 89.10% 10 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #58775      +/-   ##
==========================================
- Coverage   90.13%   90.09%   -0.04%     
==========================================
  Files         640      640              
  Lines      188294   188399     +105     
  Branches    36923    36945      +22     
==========================================
+ Hits       169712   169747      +35     
- Misses      11304    11354      +50     
- Partials     7278     7298      +20     
Files with missing lines Coverage Δ
lib/repl.js 94.78% <89.10%> (-0.09%) ⬇️

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

@nodejs-github-bot
Copy link
Collaborator

@dario-piotrowicz dario-piotrowicz added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 21, 2025
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