Commit Graph

5 Commits

Author SHA1 Message Date
JINNOUCHI Yasushi
3c5b61cda1
feat: add JSON output for query() (#262)
This makes it be enable to do this.

```bash
$ nvim --headless +'=require("frecency").query { limit = 3, json = true }' +q | jq .
[
  "/path/to/most/opened/file",
  "/path/to/second/file",
  "/path/to/third/file"
]
```

* chore: add `debug_timer` option to log in timer

* fix: wait synchronously for DB not in coroutine

* feat: add `json` option to dump JSON for DB
2024-09-08 16:55:44 +09:00
JINNOUCHI Yasushi
a6482c2fbf
feat: separate bootstrap logic to launch faster (#250)
* 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
2024-08-31 15:02:15 +09:00
JINNOUCHI Yasushi
a75b403ea0
feat: pretty print timer (#251)
* feat: store times for duplicated keys

* feat: add func for pretty print timer
2024-08-27 14:49:05 +09:00
JINNOUCHI Yasushi
db32047232
feat: use lazy.nvim to measure times if usable (#249) 2024-08-25 20:31:15 +09:00
JINNOUCHI Yasushi
c140e6ff9c
feat: make query() faster and more lazier (#241)
* 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
2024-08-25 19:28:52 +09:00