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.
* 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
* feat!: remove code for SQLite
ref [Introduce revised telescope-frecency.nvim : neovim](https://www.reddit.com/r/neovim/comments/174m8zu/introduce_revised_telescopefrecencynvim/)
I have deprecated SQLite features 4 months ago. It is the time to remove
code for them.
* test: fix test to load telescope validly
* test: remove sqlite.lua from CI settings
* test: test database as native
* fix: add lacked type from old database/sqlite.lua
* docs: remove description for SQLite3 logic
* chore: fix types
* chore: add types for Database:raw_table
* fix: use plenary.path to manage paths in Windows
* fix: filter out paths validly in Windows
* fix: detect default `ignore_patterns` in Windows
fix: #169
* fix: join paths validly in Windows
* docs: fix value for `ignore_patterns` in Windows
* fix: avoid duplication of separators in paths
Fix: #171
This fixes only in native logic. The one with SQLite has still bugs.
……but that may not be fixed.
* fix!: no confirm always when `db_safe_mode` is off
Fix: #50Fix: #167
Before this, `db_safe_mode = false` makes it no confirmation in
`:FrecencyValidate!`, but it still does in `:FrecencyValidate` and the
auto validation in Neovim's startup.
After this commit, `db_safe_mode = false` makes it no confirmation
always when you see.
And `force` option in `Frecency:validate_database(force)` now means
weather it should remove files less than threshold.
* docs: add notes for lacked options
Now you can use `expand()` string to show up entries by `cwd` param.
```vim
:Telescope frecency workspace=CWD cwd=~
:Telescope frecency workspace=CWD cwd=%:p:h
```