Commit Graph

67 Commits

Author SHA1 Message Date
JINNOUCHI Yasushi
a61ede8740
feat: add healthcheck for rg/fdfind/fd (#173) 2024-01-31 08:45:26 +09:00
JINNOUCHI Yasushi
ada91ca486
feat!: remove code for SQLite (#172)
* 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
2024-01-30 18:26:07 +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
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
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
JINNOUCHI Yasushi
0a4a521471
refactor!: do nothing until calling setup() (#80)
* Use Lua function to complete tags

* Use Lua func to define validating command

* Use new API's to define options & mappings

* Add not for usage of `FrecencyValidate`
2023-04-11 11:16:52 +09:00
JINNOUCHI Yasushi
38d6743eb2
Revert "fix: set prompt filetype to TelescopePrompt (#81)" (#95)
This reverts commit e8e97eeebd.

This plugin defines the filetype `frecency` to use a customized syntax
to highlight tags in input characters. So we should use `frecency` here.

<img width="141" alt="スクリーンショット 0005-04-11 10 09 02" src="https://user-images.githubusercontent.com/1239245/231029307-e09ede61-a0ee-49fe-8fa5-25654a193ca5.png">
2023-04-11 10:10:55 +09:00
JINNOUCHI Yasushi
09269b2b9d
fix: use substr matcher to use sorting by scores (#94) 2023-04-10 17:50:37 +09:00
Lewis Russell
e5696afabd perf: reduce startup time by moving requires 2023-02-15 12:32:18 +01:00
JINNOUCHI Yasushi
62cbd4e7f5
Detect entries when it has added new ones (#87) 2022-12-28 12:25:07 +01:00
JINNOUCHI Yasushi
10771fdb7b
Use new API and add check for nvim-web-devicons (#78) 2022-11-06 13:42:32 +01:00
Sabu Siyad
e8e97eeebd
fix: set prompt filetype to TelescopePrompt (#81) 2022-11-06 13:39:01 +01:00
Munif Tanjim
72107a262f
feat: use sorter fuzzy_with_index_bias (#73) 2022-11-06 13:38:28 +01:00
JINNOUCHI Yasushi
9634c3508c
Enable to specify tags to show the tails (#77)
* Enable to specify tags to show the tails

* Add doc for show_filter_column
2022-09-27 21:09:50 +02:00
JINNOUCHI Yasushi
3ef3d6cabe
Use opts.path_display to customize (#76) 2022-09-27 21:08:14 +02:00
Munif Tanjim
6d2db0ee0c
fix: fetch lsp workspaces without triggering tag completion (#72) 2022-08-13 11:00:29 +02:00
Simon Hauser
7f4fef1a9f
Revert "fix: fetch lsp workspaces without triggering tag completion (#69)" (#71)
This reverts commit 335cff15ea.
2022-08-12 16:45:03 +02:00
Munif Tanjim
335cff15ea
fix: fetch lsp workspaces without triggering tag completion (#69) 2022-08-12 15:44:00 +02:00
Munif Tanjim
32f4b59ea1
feat: support opts.workspace (#68) 2022-08-12 15:42:45 +02:00
Munif Tanjim
388016c512
fix: show icon before directory (#67) 2022-08-12 15:42:13 +02:00
Munif Tanjim
c891e5e86c
fix: column width for cwd tag (#66) 2022-08-12 15:41:44 +02:00
Munif Tanjim
7b79627fd4
fix: healthcheck (#65) 2022-08-12 15:41:25 +02:00
Matteo Bigoi
68ac8cfe67
fix: ore robust handling of configuration defaults. (#57) 2022-05-25 08:44:48 +02:00
Taylon
979a6f3d88
fix: only show filter column when show_filter_column is true (#51) 2021-12-06 21:10:27 +01:00
James Hiew
ea44b316f4
feat: add default_workspace setting (#43) 2021-11-23 19:07:11 +01:00
Fabian Langguth
4c46d46859
feat: use telescope builtin transform_path (#46)
Telescope has changed the way how the options for path transform can be
set. Use the appropriate new interface to transform the paths for
display.
2021-10-04 21:04:24 +02:00
Senghan Bright
459041fb42 fix: allow preceeding spaces in filter match pattern 2021-08-05 12:40:16 +02:00
Senghan Bright
e5dd397504
feat: support devicons (#31)
* feat: support devicons

* fix: respect opts.disable_devicons

* chore: stylua format
2021-08-04 20:25:49 +02:00
Senghan Bright
65a7d89eb8 feat: make database location configurable 2021-08-04 10:52:02 +02:00
Senghan Bright
8b6f4b8981 deprecate persistent_filter.
functionality is superceded by https://github.com/nvim-telescope/telescope.nvim/pull/1051
and Telesopes native `default_text` setting.
2021-08-04 09:37:09 +02:00
Senghan Bright
6415657162 deprecate persistent_filter 2021-08-04 09:35:57 +02:00
Senghan Bright
e7c9dee1e7
feat: allow user to disable database validation safe_mode (#20)
* feat: allow user to disable database validation safe_mode

* fix safe_mode logic

* fix: fix user confirmation

* feat: allow disabling of auto-validation
2021-08-04 09:16:33 +02:00
Senghan Bright
1929fc49df feat: add checkhealth function 2021-08-04 08:53:02 +02:00
Simon Hauser
5173a42d4a
chore: move to plenary.path (#24) 2021-07-14 19:54:33 +02:00
Senghan Bright
721300e3d6
fix: map <S-Tab> to menu previous entry (#19) 2021-04-17 13:16:55 +02:00
Senghan Bright
555f170098
feat: add CWD filter (#18) 2021-04-17 12:32:29 +02:00
elianiva
926fbde059
fix: move vim.fn.nvim_feedkeys to vim.api.nvim_feedkeys (#15) 2021-03-10 20:38:25 +01:00
Simon Hauser
8b584bd88f
fix: new action interface (#12) 2021-02-22 18:48:41 +01:00
JINNOUCHI Yasushi
ffa2027102
Refactor callback (#9)
* Fix tabs

* Detect the filter faster
2021-02-10 12:39:28 +01:00
JINNOUCHI Yasushi
237ece9bfb
Disable unneeded overriding mappings (#7) 2021-02-10 12:14:26 +01:00
Senghan Bright
3f6025c78a fix empty listing on windows. 2021-02-10 12:07:27 +01:00
Senghan Bright
7afdd3c32c
Feature: filtered workspaces
* draft implementation of tags/filters

* .

* add filtering:

- extended substring sorter to have modes:
- when current string is prefixed by `:foo`, results are tag_names that
come from tags/workspaces table. (if `:foo ` token is incomplete it is
ignored)
- when a complete workspace tag is matched ':foobar:', results are
indexed_files filtered by if their parent_dir is a descendant of the
workspace_dir
- a recursive scan_dir() result is added to the  :foobar: filter
results; any non-indexed_files are given a score of zero, and are
alphabetically sorted below the indexed_results

- tab completion for tab_names in insert mode`:foo|` state: cycles
through available options

* add completion file

* use attach_mappings for <CR> map

* stop completion being enabled multiple times

* improve keys

* improve completion cancellation

* add dynamic `lsp` tag

* add dynamic `lsp` tag

* fix empty lsp workspaces

* remove hardcoded workspaces and allow config from ext_config

* add filter highlight and some fixes

* .

* add workspace filters to readme

* wip LSP workspace filter

* merge ignore_patterns fix

* change LSP_ROOT tagname to LSP

* fix setting default values

* .

* update readme with filter instructions

* remove debug message

* improve relative paths

* improve relative paths

* WIP dynamic column sizes

* WIP filter_column_width

* fix keymaps

* .

* feat: persistent filters

* refactor config creation

* fix: filter directory column autosize

* improve LSP workspace paths

* .

* remove workspace filter output

* cache persistent filter results

* fix cached results

* .

* remove results cache; sorting is the expensive part

* respect ignore patterns for non-indexed files.

* return table on on_input_filter_cb
2021-01-28 22:45:04 +01:00
Senghan Bright
a770d59b92 use vim.startswith instead of utils string function 2021-01-20 12:17:45 +01:00
Senghan Bright
098edfc941 make relative dir setting compatible with tail_path 2021-01-19 08:35:39 +01:00
Senghan Bright
867f0d714d show dot-slash relative dir indicator 2021-01-19 08:20:07 +01:00
Senghan Bright
610febf90c fix relative dir 2021-01-19 08:07:31 +01:00
Senghan Bright
84443967fc only call os_home once; conditionally replace homedir 2021-01-19 05:39:25 +01:00
Senghan Bright
304a6bf887 shorten paths relative to user homedir 2021-01-19 05:15:40 +01:00
Senghan Bright
bbb81a6a58 remove wip commits 2021-01-18 21:32:03 +01:00
Senghan Bright
9bbbec1435 add in frecency_utils require 2021-01-18 21:08:38 +01:00