Fix: correct function and variable naming in fish completion script#2286
Open
TimSoethout wants to merge 3 commits intourfave:mainfrom
Open
Fix: correct function and variable naming in fish completion script#2286TimSoethout wants to merge 3 commits intourfave:mainfrom
TimSoethout wants to merge 3 commits intourfave:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes formatting issues in the Fish shell completion script template used by cli completion fish, correcting Go fmt.Sprintf placeholder usage so generated Fish functions/completions render with the expected command name and without %!-style formatting errors.
Changes:
- Updated Fish completion template placeholders from
%[1]to%[1]sfor correct Go string substitution. - Escaped
printfformat verbs (%s→%%s) so they remain literal in the generated Fish script.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
4bf78a9 to
ace427c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the Fish shell autocomplete script to fix formatting and variable substitution issues, ensuring correct function naming and output formatting for command completions.
Improvements to autocomplete script:
%[1]sinstead of%[1], ensuring proper variable substitution for command names throughout the script (autocomplete/fish_autocomplete). [1] [2]printfformatting to use the correct Fish and printf syntax, preventing formatting errors in completion output (autocomplete/fish_autocomplete).What type of PR is this?
What this PR does / why we need it:
PR #2270 introduced dynamic fish completions but used invalid Go format specifiers in the fish autocomplete template. The format string
%[1]was missing the type specifiers, causingfmt.Sprintfto produce malformed output like__%!_(string=appname)perform_completioninstead of__appname_perform_completion.Changes:
autocomplete/fish_autocomplete: Fixed format specifiers from%[1]to%[1]s(7 occurrences). Also escaped%sas%%sin the printf statements so they remain literal in the generated fish script.Which issue(s) this PR fixes:
Fixes #2285
Testing
TestCompletionFishFormataddedRelease Notes
@TimSoethout assisted by copilot.