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

feat: improve hx fish completion #10853

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

yuntaz0
Copy link

@yuntaz0 yuntaz0 commented May 30, 2024

  • add -w and --working-dir options
  • shorten option description
  • dynamically call hx --health

- add -w and --working-dir options
- shorten option description
- dynamically call hx --health
Copy link
Contributor

@markstos markstos left a comment

Choose a reason for hiding this comment

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

I tested this by adding it to ~/.config/fish/completions/hx.fish. It works for me. Here are some screenshots:

image
image

complete -c hx -s w -l working-dir -d "Specify initial working directory" -xa "(__fish_complete_directories)"

function __hx_langs_ops
hx --health | tail -n '+7' | awk '{print $1}' | sed 's/\x1b\[[0-9;]*m//g'
Copy link
Member

Choose a reason for hiding this comment

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

I believe this chain needs some work too. The +7 is too small - it was probably correct at the time but we have added more information to the --health output since. It could use hx --health languages and chop off the header instead.

Since --health now shows multiple language servers this also includes some check or x characters that should be removed

@the-mikedavis the-mikedavis added the A-packaging Area: Packaging and bundling label Jun 3, 2024
@yuntaz0
Copy link
Author

yuntaz0 commented Jun 5, 2024

screenshot of Fish completing hx --health:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-packaging Area: Packaging and bundling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants