* 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()
* 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!: change timing for initialization
fix#109fix#59
This fixes problems below.
* Auto-validation feature is called at Neovim starting.
- → Now it starts at `:Telescope frecency` called at the first time.
* `frecency.setup()` is called every when `:Telescope frecency` is
called.
- → Now it is called only once.
* `telescope.setup()` calls `frecency.new()` and it reads the database.
This causes time in executing `init.lua`.
- → Now it reads the database lazily. It reads at the first time when
needed.
* test: change logic to initialize config
* test: make Neovim version newer in CI
* I did an overhall for all codes and added typing by Lua-language-server and tests. It also works on CI.
* Now it searches files on the workspace completely asynchronously. It does not block your text input. (Fix#106)
Make count = 1 when you open a file you've never opened (Fix#107)