Skip to content

fix: apply smart-case behavior to searchFiles glob patterns#107

Merged
joshmu merged 1 commit intomasterfrom
fix/searchfiles-smart-case
Feb 6, 2026
Merged

fix: apply smart-case behavior to searchFiles glob patterns#107
joshmu merged 1 commit intomasterfrom
fix/searchfiles-smart-case

Conversation

@joshmu
Copy link
Owner

@joshmu joshmu commented Feb 6, 2026

Summary

Fixes #104

  • Ripgrep's --smart-case flag only affects regex pattern matching, not --glob patterns used by searchFiles. This caused lowercase file name queries (e.g. dockerfile) to return no results even when a file named Dockerfile existed.
  • Fix uses --iglob (case-insensitive glob) when --smart-case is set and the query is all lowercase, and --glob when it contains uppercase characters.
  • Also handles --ignore-case and --case-sensitive flags appropriately.

Test plan

  • Added test: searchFiles with --smart-case finds Dockerfile via lowercase query dockerfile
  • Added test: searchFiles with --smart-case finds Dockerfile via mixed-case query Docker
  • Added Dockerfile fixture at test/fixtures/workspace/build/
  • Existing tests pass (lint, typecheck, 184 tests)
  • Manual: set "periscope.rgOptions": ["--smart-case"], run periscope.searchFiles, type dockerfile → should find Dockerfile

Ripgrep's --smart-case flag only affects regex pattern matching, not
--glob patterns used by searchFiles. This caused lowercase file name
queries (e.g. "dockerfile") to return no results when --smart-case was
enabled, even though a file named "Dockerfile" existed.

Fix by using --iglob (case-insensitive glob) when --smart-case is set
and the query is all lowercase, and --glob when the query contains
uppercase characters. Also handles --ignore-case and --case-sensitive
flags appropriately.
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

✅ Tests passed on ubuntu-latest

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

✅ Tests passed on macos-latest

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

✅ Tests passed on windows-latest

@joshmu joshmu merged commit 475b0c2 into master Feb 6, 2026
3 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

🎉 This PR is included in version 1.16.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--smart-case doesn't apply to searchFiles

1 participant