adaszko / complgen

Declarative bash/fish/zsh completions without writing shell scripts
Apache License 2.0
221 stars 7 forks source link

[FR] <PATH> behaviour inconsistent with non-complgen path completion #46

Open degnbol opened 7 months ago

degnbol commented 7 months ago
completes paths in a basic way that isn't identical to path completion for commands where completion isn't made with complgen. I'm using zsh. It ignores zstyle settings related to e.g. ignoring case and adding a space after filename completion. As a side note, I see that `_path_files` is being called in the code so I tried redefining , e.g. for ignoring case: ``` ::= {{{ _path_files -M 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' }}} ``` The -M flag seems to be ignored. I'm able to have other flags work, e.g. -F for ignoring patterns. This might be an issue with my setup somehow and not related to complgen. Thanks for the great project btw, I'm playing around with a (very heuristic) help text parser that goes well with this.
adaszko commented 7 months ago

I appreciate reporting! Will definitely take a look as soon as I find some time

adaszko commented 7 months ago

Could you please post the output of complgen version and the minimal .usage file that triggers the behavior? TIA

degnbol commented 7 months ago

complgen version 0df6f4d9a1

And simply a file ~/.config/complgen/minimal.usage with contents: minimal <PATH>;

I just double checked to make sure, and without the file minimal <TAB> completes file ignoring case etc. (default completion for unknown command is filepath, at least in my setup), while placing the file completes it in a case sensitive manner.

Hope this helps, I can provide Zsh configs if needed.

adaszko commented 4 months ago

Hi, sorry for a late reply.

Are you using JIT or AOT mode?

Adding completions under zsh ultimately boils down to calling compadd -A, so it should be respecting all zstyles.

Perhaps you would be willing to contribute a test case for this issue? Tests under e2e/zsh are a starting point JIT/AOT, depending on your context.

Thanks for the great project btw, I'm playing around with a (very heuristic) help text parser that goes well with this.

Take a look at complgen scrape -- I'd be very happy to accept PRs.