janetsh icon indicating copy to clipboard operation
janetsh copied to clipboard

User callback for argument completion

Open ALSchwalm opened this issue 5 years ago • 2 comments

It would be nice to allow users to register callbacks for completing a command. This would allow them to keep the normal completion logic we have while getting custom stuff for completing e.g. git. It would also save people from needing to redundantly implement parsing logic, etc. I'm thinking something like: https://elv.sh/ref/edit.html#argument-completer

It would probably be best to wait to do this until after janet-lang/janet#121 is implemented, but I thought I'd go ahead and open an issue.

ALSchwalm avatar Jun 06 '19 02:06 ALSchwalm

I think it is reasonable to guide people in the right direction on this without necessarily implementing everything ourselves, so I agree a common extension point is reasonable.

andrewchambers avatar Jun 06 '19 04:06 andrewchambers

Another thought, once the coprocess function is added, people can spawn completion servers implemented in other shells which will be cool.

andrewchambers avatar Jun 06 '19 04:06 andrewchambers