Commit Graph

19 Commits

Author SHA1 Message Date
JINNOUCHI Yasushi
42b6421061
feat: add fuzzy matching sorter experimentally (#166)
* 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`
2024-04-28 17:58:45 +09:00
JINNOUCHI Yasushi
2a22815b09
Simplify code with using frecency.config (#189)
* 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
2024-03-25 18:45:45 +09:00
JINNOUCHI Yasushi
9126d6bc0c
fix: fix type names to avoid conflicting (#186) 2024-03-23 16:49:39 +09:00
JINNOUCHI Yasushi
747894efd1
feat: use improved telescope's matcher (#184)
ref #177
ref https://github.com/nvim-telescope/telescope.nvim/pull/2950

Now telescope has the same matcher as the one #177 has introduced. This
commit makes it use that.
2024-03-20 18:15:20 +09:00
JINNOUCHI Yasushi
771726f7d6
feat: match like 'smartcase' (#177)
* feat: match like 'smartcase'

Fix #36

* docs: add note for 'smartcase'

* docs: emphasize requirements
2024-02-25 14:25:40 +09:00
JINNOUCHI Yasushi
4f3e007ec2
feat: hide_current_buffer option (#176)
* feat: `hide_current_buffer` option

* docs: add `hide_current_buffer` option
2024-02-16 14:36:04 +09:00
JINNOUCHI Yasushi
a3e818d001
fix: fix joining paths in Windows (#168)
* 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.
2024-01-28 15:52:47 +09:00
JINNOUCHI Yasushi
da7c724e3c
List up entries for workspace files by rg or fd (#156)
* 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
2024-01-01 00:12:17 +09:00
Will Hopkins
4bdd9bafc7
fix: workspace filtering (#150)
* fix: call `finder:start()` separately from finder init

fixes #149

* fix: show filter column for default workspace if enabled
2023-10-01 16:20:33 +09:00
JINNOUCHI Yasushi
767fbf074f
feat: check DB file has been changed (#143)
* 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
2023-09-17 15:21:01 +09:00
JINNOUCHI Yasushi
9037d696e6
feat: add logic to store data by native code (#130)
* 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
2023-08-27 18:51:16 +09:00
JINNOUCHI Yasushi
2e9cbda5cf
fix: use the default filetype for the prompt (#134) 2023-08-25 20:49:45 +09:00
JINNOUCHI Yasushi
07e0f87ebd
refactor: remove logic for caching feature (#126)
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.
2023-08-13 15:15:35 +09:00
JINNOUCHI Yasushi
2ac311a266
fix: reflow results to show valid ones (#123)
* fix: clear non-matched results in results buffer

* fix: show high-scored results in the first view

This is for sorting_strategy = 'descending'
2023-08-12 15:30:25 +09:00
JINNOUCHI Yasushi
1acb245b01
fix: deal with files that have no timestamps (#120)
* 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.
2023-08-11 09:52:28 +09:00
JINNOUCHI Yasushi
2ffcfd00ed
fix: deal with default_workspace option (#114) 2023-08-07 07:38:21 +09:00
JINNOUCHI Yasushi
1f32091e2b
refactor!: use OO & add tests (#100)
* 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)
2023-08-06 16:02:37 +09:00
Mr.Z
1b1cf6aead
fix:can't display file name if config show_filter_column is false (#102)
Co-authored-by: zhaogang <zhaogang@dustess.com>
2023-08-06 07:37:44 +09:00
JINNOUCHI Yasushi
3f709af755
refactor: reach the master (#93)
* refactor(db): use new sql.nvim api

* refactor(*): create const, algo and add more util

* refactor(picker): try to cleanup and make it easy to read

FIXME: it seems that I didn't refactor the entry maker right.

* refactor(*): move util to lua/frecency

* misc(db): flag possible bug

* refactor(db): reflect changes introduced in https://github.com/tami5/sql.nvim/pull/96

* refactor(db): move set_config to frecency.lua

* new(db): ignore term and octo paths

This may possibly fix the issue with entry.count being nil.

* misc(picker): move health out of export

* refactor(util)

* refactor(db): general

* misc(*): nothing major

* refactor(db): abbreviate table namespace access

* refactor(picker): working-ish

* fix(*): general

* refactor(picker): move fd function to the end of the file

* refactor(*): remove the need for db.init

* new(db): use foreign keys

* sync with sqlite.lua@#105

* feat: add settings for StyLua

* fix: detect the valid module in healthcheck

See #65

* style: fix by StyLua

* fix: detect CWD tag to cut paths

See #66

* fix: show icon before directory

See #67

* fix: deal with show_filter_column option validly

* feat: support opts.workspace (#68)

* doc(readme): update config example (#33)

remove comma causing error.

* doc(readme): fix packer install instructions (#34)

Co-authored-by: tami5 <65782666+tami5@users.noreply.github.com>

* doc: follow sqlite new release (#40)

* refactor(sql_wrapper): follow sqlite new release

* update readme

* refactor: follow telescope's interface changes

See #46

* feat: add default_workspace tag

See #43

* fix: fetch workspaces in addition to completing

See #72

* Update url for sqlite dependency (#64)

The old repository on github redirects to this one.

* fix: use vim.notify not to block outputs

See #75

* feat: opts.path_display to customize

See #76

* Enable to specify tags to show the tails (#77)

* Enable to specify tags to show the tails

* Add doc for show_filter_column

* feat: use more reasonable matcher to sort

See #73

* Fix broken Frecency Algorithm link in README.md (#82)

MDN appear to have removed the Frecency Algorithm page linked in the README document. Updating link to use archived version.

* fix: set the telescope default filetype in prompt

See #81

* feat: use the newer API to define autocmds

See #79

* refactor: use new API and add check for devicons

* feat: detect entries when it has added new ones

See #87

* fix: use valid widths to show entries

* fix: use substr matcher to use sorting by scores

See #94

* Revert "fix: set the telescope default filetype in prompt"

This reverts commit 4937f7045438412e31a77374f91230bdbcbeb34d.

* fix: enable to filter by valid paths

* refactor: do nothing until calling setup()

See #80

* fix: fix typo for `workspaces`

* fix: show `0` score for unindexed instead of `nil`

* style: fix by StyLua

* fix: return a valid entry with get()

It have used where() to get the entry and where() uses get() to fetch
from DB. But this table has been customized by overwriting get(), so it
has a bug to return the same entry every time it calls. This fixes it.

* refactor: get the buffer name explicitly

* fix: clean up logic to validate DB

* feat: enable to work db_root option

* fix: show no msg when no need to validate in auto

---------

Co-authored-by: Tami <65782666+tami5@users.noreply.github.com>
Co-authored-by: Munif Tanjim <hello@muniftanjim.dev>
Co-authored-by: premell <65544203+premell@users.noreply.github.com>
Co-authored-by: Anshuman Medhi <amedhi@connect.ust.hk>
Co-authored-by: Lucas Hoffmann <lucc@users.noreply.github.com>
Co-authored-by: Rohan Orton <rohan.orton@gmail.com>
2023-06-10 14:37:08 +09:00