Return only commands when completing help command's argument#973
Merged
Return only commands when completing help command's argument#973
Conversation
st0012
commented
Jun 17, 2024
tompng
reviewed
Jun 19, 2024
| yield | ||
| ] | ||
|
|
||
| HELP_COMMAND_PREPOSING = /\Ahelp\s+/ |
Member
There was a problem hiding this comment.
I think each command can have a completion and colorization for command arguments (as an internal api).
Do you think we should do it now or not or maybe later?
I'm thinking of something like this
if command? && argument_part?
# pass completor so that command can fallback to completor if the arg part is a ruby code
return command_instance._internal_complete(command_arg, completor)
end
Member
Author
There was a problem hiding this comment.
IMO, we should first finish completion support for signature arguments too, like show_source and edit's, before designing any public API. This is to make sure we know what we want and don't want to expose. I also don't see too strong of a demand for such feature yet, so I think we can wait a bit.
The command only takes command names as arguments, so we should only return command names as candidates. This will help users find a command faster as completion will be another useful hint too.
0eb9376 to
22b016b
Compare
tompng
approved these changes
Jul 5, 2024
matzbot
pushed a commit
to ruby/ruby
that referenced
this pull request
Jul 5, 2024
argument (ruby/irb#973) The command only takes command names as arguments, so we should only return command names as candidates. This will help users find a command faster as completion will be another useful hint too. ruby/irb@7b6557cc24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The command only takes command names as arguments, so we should only return command names as candidates.
This will help users find a command faster as completion will be another useful hint too.