Skip to content

feat(nvim): show definitions first in live grep by default - #930

Open
dmtrKovalenko wants to merge 2 commits into
codex/mcp-search-parityfrom
codex/nvim-classify-default
Open

dmtrKovalenko wants to merge 2 commits into
codex/mcp-search-parityfrom
codex/nvim-classify-default

Conversation

@dmtrKovalenko

@dmtrKovalenko dmtrKovalenko commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Live grep shows matching definitions before usages within each page by default. content_search keeps file order unless the caller passes classify_definitions or the user config sets grep.classify_definitions.


Setting Before After
Live grep default Matches in file order Definitions, a Definitions divider, then usages
content_search default File order File order (unchanged)
Cost per page (#924 benchmark) 1.09 ms 1.10 ms

Note

content_search follows grep.classify_definitions only when the user config sets it, so programmatic results keep the released v0.11.0 order.

The snapshots from #924 cover the grouped page and divider navigation for both prompt positions. Specs check that a default picker search requests classify and that content_search requests off until the user config enables it.

Stacked on #928.

Stack merge order: #924, #925, #927, #928, #930, #931, #932, #940, #933, #934.

Summary by CodeRabbit

  • New Features
    • Definition classification is enabled by default for live grep.
    • Content search follows the configured classification setting; when none is available, classification remains off.
    • Search scopes now distinguish checkout-anchored paths from nested matches, improving how hidden directories and path constraints are handled.
    • Exact filename matches use parent-directory similarity as a tie-breaker.
  • Documentation
    • Updated search documentation to reflect the default behavior and configuration options.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 558fda87-a5de-46fb-b920-612466df9e31
📥 Commits

Reviewing files that changed from the base of the PR and between 83e4c0a and 26d69e1.

📒 Files selected for processing: 3
  • README.md
  • lua/fff/main.lua
  • tests/programmatic_search_spec.lua

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

📝 Walkthrough

grep.classify_definitions now defaults to true. When content_search receives no explicit option, it reads the global grep setting if available and otherwise uses false. The README and tests reflect these settings.

Changes: Definition classification settings

Layer / File(s) Summary
Grep default and documentation
lua/fff/conf.lua, tests/grep_classification_spec.lua, README.md
The grep configuration default changes to true. The README updates its examples and guidance. A bridge test checks that a search without options passes classification mode.
Programmatic search fallback
lua/fff/main.lua, tests/programmatic_search_spec.lua
When content_search receives no explicit classification option, it reads vim.g.fff.grep.classify_definitions if the global configuration and grep field are tables. Otherwise, it uses false. The test checks the default and enabled modes.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Feature

Suggested reviewers: gustav-fff

Merge Risk: ⚪ Minimal · up to 26d69

Definition classification follows the documented defaults and modes; no actionable merge risk remains.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: live grep shows definitions first by default.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Live grep and content_search now group matching definitions before usages within each page unless grep.classify_definitions is false.
The new picker default does not change programmatic results: content_search classifies only when the caller or the user config asks for it.

This branch has not been deployed

No deployments
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.

1 participant