Skip to content

fix: restore FFFClearCache command implementation#338

Open
kuishou68 wants to merge 1 commit intodmtrKovalenko:mainfrom
kuishou68:cocoon/fix-clear-cache-command
Open

fix: restore FFFClearCache command implementation#338
kuishou68 wants to merge 1 commit intodmtrKovalenko:mainfrom
kuishou68:cocoon/fix-clear-cache-command

Conversation

@kuishou68
Copy link
Copy Markdown

Summary

  • add the missing require('fff').clear_cache() implementation behind :FFFClearCache
  • wire the advertised all|frecency|files modes to the existing cache cleanup primitives
  • add focused Lua tests covering the default, frecency, and files paths

Notes

  • I couldn't run the Neovim/Rust test stack in this sandbox because nvim and cargo are unavailable here.
  • The fix is intentionally narrow: it restores the missing command target and keeps the cache clearing behavior in one Lua entrypoint.

Closes #169


local ok = true

if scope == 'all' or scope == 'files' then
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I don't really know if this is something people will be actually using. It just cleans in memory

@@ -0,0 +1,46 @@
---@diagnostic disable: undefined-global

describe('clear_cache', function()
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

idk about this test it is too mocky but I don't want to make the real test that cleans my db. We should either have a test that provides custom paths for databases and verifies they are cleaned or just get rid from this test

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.

FFFClearCache user command: function clear_cache does not exist

2 participants