-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add support for scopes in hh autocomplete #4593
Add support for scopes in hh autocomplete #4593
Conversation
…o feature/4836-add-scopes-to-autocomplete
🦋 Changeset detectedLatest commit: 7263a06 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…hub.com/NomicFoundation/hardhat into feature/4836-add-scopes-to-autocomplete
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.
This doesn't seem to working for the flags/params of the scoped tasks. For example, given this:
scope("my-scope").task("my-task").addFlag("foo")
then doing hh my-scope my-task --<tab>
should suggest --foo
.
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.
Minor cosmetic comments; feel free to merge after applying (or not) them, assuming tests pass.
// If there's no task or scope, we complete either tasks and scopes or params | ||
if ( | ||
(taskName === undefined || tasks[taskName] === undefined) && | ||
(scopeName === undefined || scopes[scopeName] === undefined) |
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.
Can this condition be simplified to taskDefinition === undefined && scopeDefinition === undefined)
?
if ( | ||
taskName === undefined && | ||
scopeName !== undefined && | ||
scopes[scopeName] !== undefined |
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.
Similar comment here: can we use scopeDefinition
and taskDefinition
?
See issue here