-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
repl: tab completion targets <class> instead of new <class>
#60319
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
repl: tab completion targets <class> instead of new <class>
#60319
Conversation
|
hi @Renegade334, sorry for pinging but can you help review this one? I hope everything's up to par with expected quality for a |
lib/internal/repl/completion.js
Outdated
| // we want to extract the callee for completion (e.g. for `new Sample` we want `Sample`) | ||
| if (lastBodyStatement.type === 'ExpressionStatement' && | ||
| lastBodyStatement.expression.type === 'NewExpression' && | ||
| lastBodyStatement.expression.callee.type === 'Identifier') { |
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.
Is this check necessary? It excludes MemberExpressions (the same logic should apply to new X.Y. as applies to new X.).
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.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #60319 +/- ##
========================================
Coverage 88.53% 88.53%
========================================
Files 704 703 -1
Lines 208087 208270 +183
Branches 40006 40158 +152
========================================
+ Hits 184223 184391 +168
- Misses 15869 15885 +16
+ Partials 7995 7994 -1
🚀 New features to boost your workflow:
|
|
CI is complaining that you have a double-space in your first commit message, can you please amend this? |
39c7534 to
bfeae87
Compare
I've fixed in the HEAD commit. Apologies for the force push, I had to rebase and pick |
Signed-off-by: hainenber <dotronghai96@gmail.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
bfeae87 to
3549c25
Compare
|
Landed in d729bec |

Summary
Fixes #60306
I've modified the function
findExpressionCompleteTargetto handle autocompletion fornew <class>code by detecting proper identifiers and re-parse only for<class>identifier instead.Testing