Deep suggestions based on task names #2731
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds an addition suggestion to the
Try ... to see what's available
error message based on the task names present in the entire build.Before:
After:
This should help in the common case where someone runs a task with the correct name but in the wrong module. We do a fuzzy match, so even if there's a small typo we still are able to give a suggestion. This is complementary to the existing help message, which is useful when the user runs a task with the wrong name but in the correct module
The way this works is that we capture all the non-command task names in the
Discover
macro, and when a user runs a task that fails to resolve, we look at the last segment of the query and run a fuzzy search against the set. If a fuzzy match is found, we suggest to the user to runmill resolve __.foo
so they have a way to see what the fully-qualified name of the task they were trying to run, and run it. Given the typical build would have O(10s) to O(100s) of modules at most, we can expect even the most verbosemill resolve __.foo
outputs to be small enough that the user can browse through and find what they want