Open
Conversation
WalkthroughAdds Fish shell completion: new Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Shell as Fish shell
participant CLI as resticprofile CLI
participant Completer as Completer
participant FS as Filesystem
Shell->>CLI: invoke __resticprofile_completion -> run resticprofile complete --requester=fish --line/point
CLI->>Completer: Complete(requester="fish", line, point)
Completer->>Completer: format options with includeDescription=true
Completer-->>CLI: return completions (with descriptions)
CLI-->>Shell: print completions
alt file completion needed
CLI->>FS: request path completions
FS-->>CLI: path candidates
CLI-->>Shell: merged path completions
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@complete.go`:
- Around line 177-182: isOwnCommand fails to match when formatOwnCommand injects
a tab and description because it compares commandDef.name to the full formatted
string; update isOwnCommand to strip any tab-delimited description before
comparing (e.g. take substring before '\t' or split with
strings.SplitN(formatted, "\t", 2)[0]) so that comparisons against
commandDef.name work regardless of includeDescription; locate references in
toCompletionsWithProfilePrefix -> isOwnCommand and ensure the normalized
(name-only) value is used for the exact match against commandDef.name and any
subsequent logic.
In `@contrib/completion/fish-completion.fish`:
- Around line 65-75: In __resticprofile_completion the loop currently uses
"string match --regex '^[\r\n\t ]+$' -- \"$value\"; and return" which exits the
entire function when a whitespace-only completion is seen; change that to use
"and continue" so only the current iteration is skipped and previously
accumulated completions are preserved, and add the --quiet flag to string match
(i.e. "string match --quiet --regex '^[\r\n\t ]+$' -- \"$value\"; and continue")
to prevent matched whitespace from being printed as a spurious completion.
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.
Hi,
I had a go at creating a fish completion script. I modified the
resticprofile completecommand to output command descriptions which fish can use. I also added usage documentation.