You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(fuzzy): make frecency database path configurable
This adds a new frecency config table with options to enable it, set the
database path, and tweak locking.
It also deprecates the old boolean flags `fuzzy.use_frecency` and
`fuzzy.use_unsafe_no_lock`, showing a heads-up notice when used.
```lua
fuzzy = {
-- OLD
use_frecency = true,
use_unsafe_no_lock = false,
-- NEW
frecency = {
enabled = true,
unsafe_no_lock = false,
}
}
```
If an old frecency database directory exists, it will be automatically
migrated to the new configurable location, no manual steps needed.
Closes#2006
-- UNSAFE!! When enabled, disables the lock and fsync when writing to the frecency database.
415
+
-- This should only be used on unsupported platforms (i.e. alpine termux)
416
+
unsafe_no_lock=false,
417
+
},
418
+
use_frecency=true, -- deprecated alias for frecency.enabled, will be removed in v2.0
419
+
use_unsafe_no_lock=false, -- deprecated alias for frecency.unsafe_no_lock, will be removed in v2.0
410
420
411
421
-- Proximity bonus boosts the score of items matching nearby words
412
422
-- Note, this does not apply when using the Lua implementation.
413
423
use_proximity=true,
414
424
415
-
-- UNSAFE!! When enabled, disables the lock and fsync when writing to the frecency database. This should only be used on unsupported platforms (i.e. alpine termux)
416
-
-- Note, this does not apply when using the Lua implementation.
417
-
use_unsafe_no_lock=false,
418
-
419
425
-- Controls which sorts to use and in which order, falling back to the next sort if the first one returns nil
420
426
-- You may pass a function instead of a string to customize the sorting
Copy file name to clipboardExpand all lines: lua/blink/cmp/config/fuzzy.lua
+61-6Lines changed: 61 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,18 @@
1
1
--- @class (exact) blink.cmp.FuzzyConfig
2
2
--- @fieldimplementationblink.cmp.FuzzyImplementationType Controls which implementation to use for the fuzzy matcher. See the documentation for the available values for more information.
3
3
--- @fieldmax_typosnumber | fun(keyword: string): number Allows for a number of typos relative to the length of the query. Set this to 0 to match the behavior of fzf. Note, this does not apply when using the Lua implementation.
4
-
--- @fielduse_frecencyboolean Tracks the most recently/frequently used items and boosts the score of the item. Note, this does not apply when using the Lua implementation.
4
+
--- @fielduse_frecencyboolean (deprecated) alias for frecency.enabled, will be removed in v2.0
5
+
--- @fielduse_unsafe_no_lockboolean (deprecated) alias for frecency.unsafe_no_lock, will be removed in v2.0
5
6
--- @fielduse_proximityboolean Boosts the score of items matching nearby words. Note, this does not apply when using the Lua implementation.
6
-
--- @fielduse_unsafe_no_lockboolean UNSAFE!! When enabled, disables the lock and fsync when writing to the frecency database. This should only be used on unsupported platforms (i.e. alpine termux). Note, this does not apply when using the Lua implementation.
7
7
--- @fieldsortsblink.cmp.Sort[] Controls which sorts to use and in which order.
8
+
--- @fieldfrecencyblink.cmp.FuzzyFrecencyConfig Tracks the most recently/frequently used items and boosts the score of the item. Note, this does not apply when using the Lua implementation.
--- @fieldenabledboolean Whether to enable the frecency feature
13
+
--- @fieldpathstring Location of the frecency database
14
+
--- @fieldunsafe_no_lockboolean UNSAFE!! When enabled, disables the lock and fsync when writing to the frecency database. This should only be used on unsupported platforms (i.e. alpine termux).
--- @fielddownloadboolean Whenther or not to automatically download a prebuilt binary from github. If this is set to `false`, you will need to manually build the fuzzy binary dependencies by running `cargo build --release`. Disabled by default when `fuzzy.implementation = 'lua'`
12
18
--- @fieldignore_version_mismatchboolean Ignores mismatched version between the built binary and the current git sha, when building locally
0 commit comments