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

Merged
merged 4 commits into from
Jul 10, 2024

Conversation

yuntaz0
Copy link
Contributor

@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
Contributor Author

yuntaz0 commented Jun 5, 2024

screenshot of Fish completing hx --health:
image

@archseer archseer merged commit 86982ab into helix-editor:master Jul 10, 2024
6 checks passed
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
* feat: improve hx fish completion

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

* feat: improve health check completion

- remove header
- remove check/x characters

* feat: use hx --health languages in completion
mxxntype pushed a commit to mxxntype/helix that referenced this pull request Aug 14, 2024
* feat: improve hx fish completion

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

* feat: improve health check completion

- remove header
- remove check/x characters

* feat: use hx --health languages in completion
kyruzic pushed a commit to kyruzic/helix that referenced this pull request Sep 27, 2024
* feat: improve hx fish completion

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

* feat: improve health check completion

- remove header
- remove check/x characters

* feat: use hx --health languages in completion
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.

4 participants