Mirror excerpt completion across shells (#1525) - #2166
Merged
Conversation
The bash and zsh completion scripts already enumerated every excerpt flag, but the fish completion omitted --start / --end so fish users got no suggestion when typing those prefixes after `excerpt`. Add the two flags to GetFishCompletions and a new PrintCompletions_ExcerptFlagSetsMatchAcrossShells test that parses each shell's completion output for the excerpt branch and asserts the bash, zsh, and fish flag sets are identical (modulo the universal --help). Fixes #1525
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.
Summary
--start/--endto the fish completion script for theexcerptsubcommand so fish users get the same suggestions bash and zsh already provide for the documentedexcerpt <path> --start <line> [--end <line>]signature.PrintCompletions_ExcerptFlagSetsMatchAcrossShellsto lock in parity between the bash, zsh, and fish flag sets forexcerpt, so future drift in any one shell is caught at build time.changelog.d/unreleased/1525.fixed.md.Notes
ConsoleUi.cs:589-631 — bash-completion table for excerpt omits the two flags) is outdated: bash already enumerates--focus-column/--focus-length(and a regression guard inPrintCompletions_BashAndZshKeepFocusOptionsExcerptOnlyalready asserts that). The actual parity gap was on the fish side (--start/--end), which the new test now also covers.Test plan
dotnet build CodeIndex.sln -c Releasedotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj -c Release --filter FullyQualifiedName~ConsoleUiTests(39 passed)dotnet test CodeIndex.sln -c Release(4590 passed, 3 skipped — perf tests)dotnet run --project tools/CodeIndex.Changelog -- check(33 fragments validated)Fixes #1525