Skip to content

chore: vim.F deprecated#2720

Merged
phanen merged 1 commit into
mainfrom
F
May 6, 2026
Merged

chore: vim.F deprecated#2720
phanen merged 1 commit into
mainfrom
F

Conversation

@phanen
Copy link
Copy Markdown
Collaborator

@phanen phanen commented May 6, 2026

neovim/neovim#39495

Summary by CodeRabbit

  • New Features

    • Added compatibility helpers to the utilities layer to smooth differences across Neovim versions.
  • Refactor

    • Internal callers switched to the new compatibility helpers to standardize nil/default handling and module loading.
  • Bug Fixes

    • Re-enabled a previously skipped error-handling test to improve test coverage and reliability.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f75b0626-44cc-475a-906c-b67d0d5fe768

📥 Commits

Reviewing files that changed from the base of the PR and between b8ab290 and 58b4aed.

📒 Files selected for processing (7)
  • lua/fzf-lua/actions.lua
  • lua/fzf-lua/make_entry.lua
  • lua/fzf-lua/previewer/builtin.lua
  • lua/fzf-lua/profiles/cli.lua
  • lua/fzf-lua/utils.lua
  • lua/fzf-lua/win.lua
  • tests/actions_spec.lua
💤 Files with no reviewable changes (1)
  • tests/actions_spec.lua
🚧 Files skipped from review as they are similar to previous changes (1)
  • lua/fzf-lua/win.lua

📝 Walkthrough

Walkthrough

This PR adds compatibility shims in lua/fzf-lua/utils.lua (nonnil, npcall, nil_wrap) and updates call sites to use these utilities; it also tweaks ffi loading and removes a skipped test. No public API signatures were changed. (≤50 words)

Changes

Neovim API Compatibility Refactoring

Layer / File(s) Summary
Compatibility Abstractions
lua/fzf-lua/utils.lua
Added M.nonnil, M.npcall, and M.nil_wrap as backward/forward-compatibility wrappers around vim.nonnil/vim.F.if_nil, vim.npcall/vim.F.npcall, and vim.F.nil_wrap (fallback using M.npcall).
Core Call-site Updates
lua/fzf-lua/actions.lua, lua/fzf-lua/make_entry.lua, lua/fzf-lua/previewer/builtin.lua, lua/fzf-lua/win.lua
Replaced direct uses of vim.F.nil_wrap with utils.nil_wrap, and vim.F.if_nil with utils.nonnil in dynamic method invocation, glob-to-regex mapping, extmark creation, previewer defaults, and window autoclose handling.
Module Loading
lua/fzf-lua/profiles/cli.lua
Changed ffi loading from vim.F.npcall(require, "ffi") to attempting package.preload.ffi() before leaving ffi nil.
Tests
tests/actions_spec.lua
Removed a MiniTest.skip(...) line so the "ui don't freeze on error" test is no longer skipped.

Sequence Diagram(s)

(Skipped — changes are compatibility shims and small control-flow edits; no new multi-component sequential flow requiring visualization.)

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly Related PRs

  • ibhagwan/fzf-lua#2580: Overlaps with previewer/builtin.lua refactors affecting extmark and nil-wrapper usage.

Suggested Reviewers

  • ibhagwan

"I hopped through code with gentle cheer,
Wrapped nils and ffi so all can run clear,
Tests wake up, extmarks hum in tune,
A rabbit's nibble under the moon 🐰✨"

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: vim.F deprecated' accurately describes the main objective of the pull request, which is to replace deprecated vim.F utilities with compatibility wrappers throughout the codebase.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch F

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 and usage tips.

@phanen phanen merged commit 17e3507 into main May 6, 2026
10 checks passed
@phanen phanen deleted the F branch May 6, 2026 14:19
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