docs: add note for FrecencyOpts (#208)

* docs: add lacked help tags

* docs: add FrecencyOpts and its explanation
This commit is contained in:
JINNOUCHI Yasushi 2024-06-01 11:46:19 +09:00 committed by GitHub
parent 8783a062f7
commit 14cb823ec2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 41 additions and 0 deletions

View File

@ -166,6 +166,7 @@ or to map to a key:
Filter tags are applied by typing the `:tag:` name (adding surrounding colons)
in the finder query. Entering `:<Tab>` will trigger omni completion |compl-omni|.
*telescope-frecency-usage-dealing-with-uppercase-letters*
------------------------------------------------------------------------------
Dealing with upper case letters
@ -228,6 +229,24 @@ You can call `setup()` with these configuration settings below.
},
},
}
<
*telescope-frecency-configuration-frecencyopts*
*FrecencyOpts*
`FrecencyOpts` is a convenient type to use your own configuration. With using
this in the type annotation, you can complete items by LSP in writing.
NOTE: You need a properly configured Language Server for this feature such as
lua-ls. https://github.com/LuaLS/lua-language-server
>lua
require("telescope").setup {
extensions = {
---@type FrecencyOpts
frecency = {
auto_validate = false,
-- …… other configs
}
},
}
<
*telescope-frecency-configuration-auto_validate*
auto_validate ~

View File

@ -1,5 +1,27 @@
local os_util = require "frecency.os_util"
---Type to use when users write their own config.
---@class FrecencyOpts
---@field recency_values? { age: integer, value: integer }[] default: see lua/frecency/config.lua
---@field auto_validate? boolean default: true
---@field db_root? string default: vim.fn.stdpath "state"
---@field db_safe_mode? boolean default: true
---@field db_validate_threshold? integer default: 10
---@field default_workspace? string default: nil
---@field disable_devicons? boolean default: false
---@field filter_delimiter? string default: ":"
---@field hide_current_buffer? boolean default: false
---@field ignore_patterns? string[] default: { "*.git/*", "*/tmp/*", "term://*" }
---@field matcher? "default"|"fuzzy" default: "default"
---@field scoring_function? fun(recency: integer, fzy_score: number): number default: see lua/frecency/config.lua
---@field max_timestamps? integer default: 10
---@field path_display? table default: nil
---@field show_filter_column? boolean|string[] default: true
---@field show_scores? boolean default: false
---@field show_unindexed? boolean default: true
---@field workspace_scan_cmd? "LUA"|string[] default: nil
---@field workspaces? table<string, string> default: {}
---@class FrecencyConfig: FrecencyRawConfig
---@field ext_config FrecencyRawConfig
---@field private values FrecencyRawConfig