* chore: track setup() time
* feat: avoid setup() to be called twice
* chore: track time between Database:start()
* feat: add bootstrap option to load DB in advance
* feat: initialize DB before frecency class starts
* chore: add more logging
* feat!: load DB in Neovim starting
only if the plugin is loaded non-lazily.
* fix: simplify logic for timer
* fix: detect error and safely finish
* chore: remove unnecessary method
* refactor: simplify logic to load web_devicons
* refactor: make register() asynchronous
* fix: load lazily modules outside this plugin
* refactor: simplify logic to wait initialization
* refactor: use uv.hrtime() instead of os.clock()
* fix: avoid errors in calling plenary.log in async
* test: store elapsed time to check in tests
* test: fix module names
This becomes a problem only in Ubuntu because macOS and Windows does not
care cases in filenames.
* test: fix types and unused modules
* style: fix by stylua
* refactor: make recency / entry_maker loaded lazily
Now it uses realpath for registering and validating DB. This means, if you have entries that has filenames differing only for case, it can deal with them as they exist.
Before this, it has miscalculated scores for such cases. For example, in case you have `/path/to/foo.lua` and `/path/to/Foo.lua`, it registers entries for each file. Now it detects accurate filename for the specified one, and removes it in validation.
* test: separate logic for utils
* fix!: register realpath for consistency
* refactor: convert fs module from class
* refactor: move db initialization phase to start()
* fix: run database:start() truly asynchronously
* fix: call each functions with async wrapping
* refactor: add types for args in command
* fix: run register() synchronously
Because vim.api.nvim_* cannot be used in asynchronous functions.
* docs: add note for calling setup() twice
* fix: run non-fast logic on next tick
* feat: call init process before telescope loading
Fix#231
This changes enable to load frecency without telescope's loading itself.
This is needed when you want to load telescope lazily, but want to start
registering process as soon as Neovim has started.
```lua
{
"nvim-telescope/telescope-frecency.nvim",
main = "frecency",
---@type FrecencyOpts
opts = {
db_safe_mode = false,
},
},
{
"nvim-telescope/telescope.nvim",
-- `cmd` opts makes lazy.nvim load telescope.nvim lazily.
cmd = { "Telescope" },
config = function()
local telescope = require "telescope"
telescope.setup {
extensions = {
other_extension = {
foo_bar = true,
},
-- Here you need no configuration opts for frecency because
-- you've already done.
}
}
-- This is still needed.
telescope.load_extension "frecency"
end,
},
```
* docs: add note for loading telescope.nvim lazily
* refactor: use vim.pesc instead of implementing
* feat: add optional func to ignore in registering
* test: add tests for ignore_register function
* docs: add note for `ignore_register` option
* docs: add note for use case of `ignore_patterns`
* feat: add function to query the DB
* docs: add documentation for frecency.query()
* test: fix tests to run with `timestamps` property
* test: add tests for frecency.query()
Fix#36
telescope.nvim's latest release 0.1.8 does not include the changes in
https://github.com/nvim-telescope/telescope.nvim/pull/2950.
So use again the original implementation.
TODO: remove this when the commit will be included in any release.
* feat: access user opts from config.ext_config
* feat!: set the default DB path to XDG_STATE_HOME
* feat: add fallback logic to detect old DB path
* docs: add note for this change
* feat:support path style
* chore: add types and comments to be readable
* fix: do not use the logic without 'filename_first'
---------
Co-authored-by: zhaogang <zhaogang@dustess.com>
* feat: add fuzzy matching sorter experimentally
* feat: add an option to select matcher logic
* feat: separate logic to match: fuzzy, fuzzy_full
* Revert "feat: separate logic to match: fuzzy, fuzzy_full"
This reverts commit 64c022904871143ab12c7d6ba29c89fbabdbe15e.
* feat: use fzy sorter and combine recency scores
* feat: enable to change logic to calculate scores
* feat: change the view for scores by config.matcher
* docs: add note in README
* docs: add note for `scoring_function`
* chore: change the position of `?`
* fix: use config module to simplify code
* test: fix tests to use frecency.config
* test: remove macOS with nightly Neovim temporarily
* fix: fix prop attributes and names
* feat: load DB as lazily as possible
* fix: move util function to test module
* feat: use one coroutine to access DB
* test: fix to wait the table to be ready
* fix: avoid race conditions
Before this, it can run require("frecency").new() duplicatedly to wait
until frecency:setup() finishes.