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

Support clink-like lua completion scripts #47

Open
remkop opened this issue May 21, 2020 · 0 comments
Open

Support clink-like lua completion scripts #47

remkop opened this issue May 21, 2020 · 0 comments

Comments

@remkop
Copy link

remkop commented May 21, 2020

Clink offers the ability to customize its shell completion with lua scripts. Some of clink's own functionality, like built-in completions, are also implemented in lua. This integration is very powerful; it makes it possible to customize the built-in completion as well as add custom completion logic.

In addition to the abilities of the lua programming language, Clink offers a parsing API that greatly simplifies the development of custom completion scripts.

This is related to our discussion in #41: supporting lua and Clink's argument parser API is one way to address the concern about the complexity of completion scripts for non-trivial commands like git.

Another benefit I can see is that by supporting this API, existing lua completion scripts can be used as is in yori, which may make the idea of migrating to yori much more attractive for clink users.
Published collections of clink completion scripts like https://github.com/vladimir-kotikov/clink-completions would instantly add to yori's power and hopefully foster community enthusiasm and engagement, since the clink project itself appears to be abandoned.

TBD:

  • The clink parser API does not have support for descriptions, so it may need to be extended to implement feature requests like Completion candidate descriptions #42
  • Clink functionality can be accessed in lua completion scripts via the clink variable. I imagine that you would want to expose a yori variable instead (but expose clink as an alias for compatibility with clink scripts)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant