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

Add zig completion #9083

Merged
merged 4 commits into from
Jul 26, 2022
Merged

Conversation

sorairolake
Copy link
Contributor

@sorairolake sorairolake commented Jul 21, 2022

Description

Add completions for the reference implementation of the the Zig programming language.

Fixes issue #

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.rst

@sorairolake sorairolake marked this pull request as draft July 22, 2022 03:42
@sorairolake sorairolake marked this pull request as ready for review July 23, 2022 06:33
complete -c zig -n "__fish_seen_subcommand_from $zig_build_generic_commands" -l verbose-llvm-ir -d "Enable compiler debug output for LLVM IR"
complete -c zig -n "__fish_seen_subcommand_from $zig_build_generic_commands" -l verbose-cimport -d "Enable compiler debug output for C imports"
complete -c zig -n "__fish_seen_subcommand_from $zig_build_generic_commands" -l verbose-llvm-cpu-features -d "Enable compiler debug output for LLVM CPU features"
complete -x -c zig -n "__fish_seen_subcommand_from $zig_build_generic_commands" -l debug-log -d "Enable printing debug/info log messages for scope"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately this disables file completions, can we add something to the -n parameter so it doesn't?
I believe that clang completions only trigger if the current token starts with -, so maybe that?

Looks really great otherwise!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The argument of --debug-log is not files (https://github.com/ziglang/zig/blob/370793a36b3de34ead8456553a2aa2c56f0d3de8/src/main.zig#L497). So, this is as expected.

I'll fix the file completion for zig cc and zig c++ to be enabled.

Change to enable filename completion on `zig cc` and `zig c++`.
@krobelus krobelus merged commit 13febcf into fish-shell:master Jul 26, 2022
@krobelus krobelus added this to the fish 3.6.0 milestone Jul 26, 2022
@sorairolake sorairolake deleted the completions/ziglang branch July 27, 2022 10:42
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants