* 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
```
* feat: read workspace files by external commands
* fix: avoid errors when it manages invalid buffers
* feat: add workspace_scan_cmd to select a way
* docs: describe `workspace_scan_cmd` option
* fix: get file lock forcibly
When Neovim ends without removing file locks, it will fail to open
frecency ever because file locks remain. This fix makes it remove file
locks when all attempts fail forcibly.
* test: avoid error in Windows
In Windows, unclosed file cannot be removed, so close it before
unlinking.
* feat: retry to unlink when it fails
* refactor: load lazily sqlite to get filename
* feat: add logic to start migration automatically
* feat: make use_sqlite = false be the default
* docs: update README for removing dependencies
* feat: migrate silently when use_sqlite = false
* chore: remove `SQLite3` from messages
* test: run again max to 5 times in Windows
* refactor: unite logic for finder & async_finder
* chore: fix types
* chore: add sleep to show results at first
* refactor: fix to find results separatedly
* test: remove unnecessary ones and fix others
* test: add matrix for 0.9.x & Windows
* test: use forked plenary.log for Windows
* test: fix to use strptime in Windows
* test: run again if segmentation fault in Windows
* test: loosen timeout for Perl
* test: use the latest plenary.nvim again
* chore: fix types
* chore: change variable name
* feat: watch changes of DB to reload
* chore: add comments to steps
* test: copy whole modules for testing in Windows
* fix: make valid paths for Windows
* test: add tests for Native
* test: use robust way to calculate time
vim.fn.strptime cannot be used in Lua loop
* chore: fix comments
* refactor: simplify the code
* test: loosen condition to detect failures
* test: disable some logging
Many loggings make the test fail.
* test: run tests sequentially in Windows
* test: loosen timeout not to fail on Windows
* refactor: make logic for Database be abstract
* feat: add logic for DB by string.dump
* fix: run with async.void to run synchronously
* test: add tests for native feature
* feat!: sort candidates by path when score is same
This is needed because candidates from SQLite is sorted by id, but ones from native is sorted by path.
* chore: clean up types
* feat: add lock/unlock feature to access DB
* test: use async version of busted
And disable benchmark tests (fix later)
* test: add tests for file_lock
* chore: use more explicit names
* chore: use plenary.log instead
* fix: wait async functions definitely
* feat: add migrator
* chore: fix logging
* fix: detect emptiness of the table
* fix: deal with buffer with no names
* test: loosen the condition temporarily
* test: add tests for migrator
* fix: return true when the table is not empty
* feat: load sqlite lazily not to require in start
* chore: add logging to calculate time for fetching
* feat: add converter from native code to SQLite
* feat: warn when sqlite.lua is not available
* feat: add FrecencyMigrateDB to migrate DB
* docs: add note for native code logic
* test: ignore type bug
It can get candidates sufficiently fast with the current logic. Remove logic
for caching feature that still remained.
----
NOTE: My box has a DB containing 1284 files and 2973 timestamps.
`:Telescope frecency` takes around 20 milliseconds on average.
* test: add tests for removing timestamps
I had a doubt when removing entries from timestamps, it could remove
ones for other files. I added tests but it was a needless fear.
* fix: deal with files that have no timestamps
I do not know why this case occurs. But care it.
* test: work tests for async_finder
I noticed these tests do not work because of vim.fs.joinpath lacking. I
will enable these tests and fix the bug.
* feat: implement vim.fs.joinpath to work in v0.9.0