-
Notifications
You must be signed in to change notification settings - Fork 389
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
cli: complete: complete -T
template aliases
#5541
Conversation
93731cb
to
ca646b8
Compare
We could also emit a description for the template, but it would only have room for one line, and I don't think that provides much value. I suppose another option would be only to display the help text for one-line templates, which is better, but probably not worth the visual clutter over the simple horizontal list of all templates. |
ca646b8
to
938e6e9
Compare
I'm not sure how major this is, but these suggestions include things like A hacky and impefect solution might be to filter the I wonder if we could/should reorganize templates by the kind of object they take, so that this would be |
Could do that, although you would lose user defined template aliases with another prefix (how common is that?) and you'd still get invalid
Hm. My gut reaction says that I would prefer to have flat Another option would be to introduce some understanding of types to the functions and symbol, but that would be an even larger undertaking and it's not clear that it is worth the complexity Sketch of adding type information to templates'commit_timestamp(commit)' = 'commit.committer().timestamp()' could be written as 'commit_timestamp(commit: Commit)' = 'commit.committer().timestamp()' and builtin_log_compact = '''
if(root,
format_root_commit(self),
...
)
''' might become 'builtin_log_compact(self: Commit)' = '''
if(root,
format_root_commit(self),
foo # implicitly self.foo
...
)
''' And then, only aliases that have a type specified and match the expected type are completed. |
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.
It might make sense to add some metadata (e.g. self
type, short documentation, etc.) to the builtin templates, but I don't have any concrete idea right now.
938e6e9
to
8a3b198
Compare
I've opened a followup issues for potential type metadata in the aliases: #5551 |
based on #5539
It would be nice to filter them down to only applicable ones, but I don't think that type information is present in the toml definitions.
Checklist
If applicable:
CHANGELOG.md