Skip to content

feat(sdk)!: add case_mode: smart, sensitive, insensitive option#609

Open
gustav-fff wants to merge 2 commits into
mainfrom
feat/case-mode-api
Open

feat(sdk)!: add case_mode: smart, sensitive, insensitive option#609
gustav-fff wants to merge 2 commits into
mainfrom
feat/case-mode-api

Conversation

@gustav-fff

Copy link
Copy Markdown
Collaborator

Split out from #561 per @dmtrKovalenko request.

What

Adds fff::CaseMode { Smart, Sensitive, Insensitive } and a new optional case_mode: Option<CaseMode> field on GrepSearchOptions. Adds GrepSearchOptions::effective_case_mode() to resolve the effective mode.

Non-breaking

The legacy smart_case: bool field is preserved. When case_mode is None, the existing boolean is used (true => Smart, false => Sensitive) — identical behavior to before. New callers that need Insensitive set case_mode = Some(CaseMode::Insensitive).

No public function signatures changed. Default still emits smart_case: true, case_mode: None. Existing consumers (fff-c, fff-nvim, benches, tests) compile unchanged.

Why this shape

The original PR #561 changed smart_case: bool to case_mode: CaseMode directly, which is a breaking field change for anyone constructing GrepSearchOptions. This PR adds the new API alongside the old one so #561 (and future consumers) can adopt case_mode without a major version bump.

How verified

cargo check -p fff-search passes. Internal call sites in grep.rs route through effective_case_mode() so behavior is preserved when only smart_case is set.

Co-authored-by: Marko Vejnovic contact@markovejnovic.com

Automated triage via Gustav. Honk-Honk 🪿

Adds explicit `CaseMode { Smart, Sensitive, Insensitive }` and a new
`case_mode: Option<CaseMode>` field on `GrepSearchOptions`. The legacy
`smart_case: bool` is preserved for backward compatibility — when
`case_mode` is `None`, the boolean is used (true => Smart, false =>
Sensitive). New callers that need `Insensitive` set `case_mode`
explicitly.

Co-authored-by: Marko Vejnovic <contact@markovejnovic.com>
@dmtrKovalenko

Copy link
Copy Markdown
Owner

@gustav-fff you need to make sure that it is getting compiled everywhere and mark

@dmtrKovalenko dmtrKovalenko changed the title feat(grep): add CaseMode enum and case_mode option (non-breaking) feat(sdk)!: add case_mode: smart, sensitive, insensitive option Jun 17, 2026
@dmtrKovalenko

Copy link
Copy Markdown
Owner

@gustav-fff also make it configurable for neovim lua

Add case_mode: None to all GrepSearchOptions construction sites across
fff-c, fff-mcp, fff-nvim, fff-python, and tests so the new field
compiles everywhere.

Expose case_mode in the neovim lua API: new optional config
grep.case_mode ("smart"|"sensitive"|"insensitive") flows through
live_grep FFI and content_search opts. smart_case remains the legacy
default; case_mode overrides it when set.
@gustav-fff

Copy link
Copy Markdown
Collaborator Author

[triage-bot] DIRECTED: pushed 2ecd02d.

  • Added case_mode: None to every GrepSearchOptions construction site across fff-c, fff-mcp, fff-nvim, fff-python, and the integration/fuzz tests so cargo check --workspace --all-targets is clean.
  • Exposed case_mode to neovim lua: new optional grep.case_mode = "smart"|"sensitive"|"insensitive" in lua/fff/conf.lua, plumbed through live_grep FFI in crates/fff-nvim/src/lib.rs:435 (parsed into Option<fff::CaseMode>), lua/fff/picker_ui/grep_renderer.lua:34, and M.content_search opts in lua/fff/main.lua:304.
  • Legacy smart_case boolean still works; case_mode overrides when set, matching effective_case_mode() semantics.

README update for the new config option not included — flagging for @dmtrKovalenko since per CLAUDE.md new neovim config options should be documented there. Want me to add a section?

Honk-Honk 🪿

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants