Repository navigation
feat: support negated terms in the file search - #165
Open
rod-stuchi wants to merge 1 commit into
Open
rod-stuchi wants to merge 1 commit into
rod-stuchi wants to merge 1 commit into
Conversation
The `t` file search now splits the query into space-separated terms that must all match (case-insensitive substrings). A term prefixed with `!` excludes files containing it, e.g. `ui !test`.
This was referenced Nov 5, 2026
rod-stuchi
marked this pull request as ready for review
November 5, 2026 18:59
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
The
tfile search now splits the query into space-separated terms that must all match (case-insensitive substrings). A term prefixed with!excludes files containing it, e.g.!testorui !test.!is ignored, so the results don't empty out while typing the termt: "search files (!term to exclude)"); the search placeholder is unchangedRelated: #164 (sticky filter) refactors the same matching loop. Once both are in, the sticky filter's
filesMatchingshould usematchesQueryso!termworks there too. Whichever lands second needs a small rebase.How Did You Test this Change?
TestMatchesQuery(table-driven: empty query, include, exclude, mixed terms, case-insensitivity, lone!, extra spaces) andTestSearchResultsExcludeNegatedTermsagainstexamples/multiple_files.diffgo test ./...andgolangci-lintv2.12.2 (0 issues)go run . < examples/gh_dash_pr.diff:!keyshidesui/keys/branchKeys.go, andui !sectioncombines an include with an exclude as expectedAI Usage
Built with Claude Code (Claude Opus 5.5). I chose the design (substring only, space-separated AND terms,
!to negate); Claude wrotematchesQueryand the tests, I reviewed the diff, moved the syntax hint from the placeholder to the help text, and tested it manually.Images/Videos