docs: fix doc types. Add lua type to opts in readme (#2200)
* docs: fix doc types. Add lua type to `opts` in readme * [pre-commit.ci lite] apply automatic fixes * chore: fix type error in sidebar.lua --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
This commit is contained in:
@@ -75,6 +75,8 @@ For building binary if you wish to build from source, then `cargo` is required.
|
||||
"yetone/avante.nvim",
|
||||
event = "VeryLazy",
|
||||
version = false, -- Never set this value to "*"! Never!
|
||||
---@module 'avante'
|
||||
---@type avante.Config
|
||||
opts = {
|
||||
-- add any opts here
|
||||
-- for example
|
||||
@@ -335,8 +337,10 @@ _See [config.lua#L9](./lua/avante/config.lua) for the full config_
|
||||
```lua
|
||||
{
|
||||
---@alias Provider "claude" | "openai" | "azure" | "gemini" | "cohere" | "copilot" | string
|
||||
---@type Provider
|
||||
provider = "claude", -- The provider used in Aider mode or in the planning phase of Cursor Planning Mode
|
||||
---@alias Mode "agentic" | "legacy"
|
||||
---@type Mode
|
||||
mode = "agentic", -- The default mode for interaction. "agentic" uses tools to automatically generate code, "legacy" uses the old planning method to generate code.
|
||||
-- WARNING: Since auto-suggestions are a high-frequency operation and therefore expensive,
|
||||
-- currently designating it as `copilot` provider is dangerous because: https://github.com/yetone/avante.nvim/issues/1048
|
||||
@@ -488,6 +492,7 @@ or you can use [Kaiser-Yang/blink-cmp-avante](https://github.com/Kaiser-Yang/bli
|
||||
```lua
|
||||
selector = {
|
||||
--- @alias avante.SelectorProvider "native" | "fzf_lua" | "mini_pick" | "snacks" | "telescope" | fun(selector: avante.ui.Selector): nil
|
||||
--- @type avante.SelectorProvider
|
||||
provider = "fzf",
|
||||
-- Options override for custom providers
|
||||
provider_opts = {},
|
||||
@@ -542,6 +547,7 @@ For enhanced input UI with better styling and features:
|
||||
```
|
||||
|
||||
You'll need to install dressing.nvim:
|
||||
|
||||
```lua
|
||||
-- With lazy.nvim
|
||||
{ "stevearc/dressing.nvim" }
|
||||
@@ -568,6 +574,7 @@ For modern, feature-rich input UI:
|
||||
```
|
||||
|
||||
You'll need to install snacks.nvim:
|
||||
|
||||
```lua
|
||||
-- With lazy.nvim
|
||||
{ "folke/snacks.nvim" }
|
||||
|
||||
@@ -60,6 +60,8 @@
|
||||
"yetone/avante.nvim",
|
||||
event = "VeryLazy",
|
||||
version = false, -- 永远不要将此值设置为 "*"!永远不要!
|
||||
---@module 'avante'
|
||||
---@type avante.Config
|
||||
opts = {
|
||||
-- 在此处添加任何选项
|
||||
-- 例如
|
||||
|
||||
@@ -21,8 +21,10 @@ local M = {}
|
||||
M._defaults = {
|
||||
debug = false,
|
||||
---@alias avante.Mode "agentic" | "legacy"
|
||||
---@type avante.Mode
|
||||
mode = "agentic",
|
||||
---@alias avante.ProviderName "claude" | "openai" | "azure" | "gemini" | "vertex" | "cohere" | "copilot" | "bedrock" | "ollama" | string
|
||||
---@type avante.ProviderName
|
||||
provider = "claude",
|
||||
-- WARNING: Since auto-suggestions are a high-frequency operation and therefore expensive,
|
||||
-- currently designating it as `copilot` provider is dangerous because: https://github.com/yetone/avante.nvim/issues/1048
|
||||
@@ -30,6 +32,7 @@ M._defaults = {
|
||||
auto_suggestions_provider = nil,
|
||||
memory_summary_provider = nil,
|
||||
---@alias Tokenizer "tiktoken" | "hf"
|
||||
---@type Tokenizer
|
||||
-- Used for counting tokens and encoding text.
|
||||
-- By default, we will use tiktoken.
|
||||
-- For most providers that we support we will determine this automatically.
|
||||
@@ -518,6 +521,7 @@ M._defaults = {
|
||||
},
|
||||
windows = {
|
||||
---@alias AvantePosition "right" | "left" | "top" | "bottom" | "smart"
|
||||
---@type AvantePosition
|
||||
position = "right",
|
||||
fillchars = "eob: ",
|
||||
wrap = true, -- similar to vim.o.wrap
|
||||
@@ -541,6 +545,7 @@ M._defaults = {
|
||||
border = { " ", " ", " ", " ", " ", " ", " ", " " },
|
||||
start_insert = true, -- Start insert mode when opening the ask window
|
||||
---@alias AvanteInitialDiff "ours" | "theirs"
|
||||
---@type AvanteInitialDiff
|
||||
focus_on_apply = "ours", -- which diff to focus after applying
|
||||
},
|
||||
},
|
||||
@@ -569,6 +574,7 @@ M._defaults = {
|
||||
},
|
||||
selector = {
|
||||
---@alias avante.SelectorProvider "native" | "fzf_lua" | "mini_pick" | "snacks" | "telescope" | fun(selector: avante.ui.Selector): nil
|
||||
---@type avante.SelectorProvider
|
||||
provider = "native",
|
||||
provider_opts = {},
|
||||
exclude_auto_select = {}, -- List of items to exclude from auto selection
|
||||
|
||||
@@ -1613,6 +1613,7 @@ local function calculate_config_window_position()
|
||||
end
|
||||
end
|
||||
|
||||
---@cast position -"smart", -string
|
||||
return position
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user