Skip to content
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

Merged
merged 15 commits into from
Nov 23, 2023

Conversation

ChristopherDedominici
Copy link
Contributor

Copy link

changeset-bot bot commented Nov 16, 2023

🦋 Changeset detected

Latest commit: 7263a06

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
hardhat Patch

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

Copy link

vercel bot commented Nov 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hardhat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 23, 2023 1:36pm

@github-actions github-actions bot added the status:ready This issue is ready to be worked on label Nov 16, 2023
Copy link
Member

@fvictorio fvictorio left a 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.

packages/hardhat-core/test/internal/cli/autocomplete.ts Outdated Show resolved Hide resolved
packages/hardhat-core/src/internal/cli/autocomplete.ts Outdated Show resolved Hide resolved
Copy link
Member

@fvictorio fvictorio left a 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)
Copy link
Member

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
Copy link
Member

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?

@ChristopherDedominici ChristopherDedominici merged commit c3aad2c into main Nov 23, 2023
84 checks passed
@ChristopherDedominici ChristopherDedominici deleted the feature/4836-add-scopes-to-autocomplete branch November 23, 2023 13:44
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:ready This issue is ready to be worked on
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add support for scopes in hh autocomplete
2 participants