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:
Avinash Thakur
2025-06-17 13:39:12 +05:30
committed by GitHub
parent b52a89cb08
commit cf87220dff
4 changed files with 16 additions and 0 deletions

View File

@@ -75,6 +75,8 @@ For building binary if you wish to build from source, then `cargo` is required.
"yetone/avante.nvim", "yetone/avante.nvim",
event = "VeryLazy", event = "VeryLazy",
version = false, -- Never set this value to "*"! Never! version = false, -- Never set this value to "*"! Never!
---@module 'avante'
---@type avante.Config
opts = { opts = {
-- add any opts here -- add any opts here
-- for example -- for example
@@ -335,8 +337,10 @@ _See [config.lua#L9](./lua/avante/config.lua) for the full config_
```lua ```lua
{ {
---@alias Provider "claude" | "openai" | "azure" | "gemini" | "cohere" | "copilot" | string ---@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 provider = "claude", -- The provider used in Aider mode or in the planning phase of Cursor Planning Mode
---@alias Mode "agentic" | "legacy" ---@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. 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, -- 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 -- 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 ```lua
selector = { selector = {
--- @alias avante.SelectorProvider "native" | "fzf_lua" | "mini_pick" | "snacks" | "telescope" | fun(selector: avante.ui.Selector): nil --- @alias avante.SelectorProvider "native" | "fzf_lua" | "mini_pick" | "snacks" | "telescope" | fun(selector: avante.ui.Selector): nil
--- @type avante.SelectorProvider
provider = "fzf", provider = "fzf",
-- Options override for custom providers -- Options override for custom providers
provider_opts = {}, provider_opts = {},
@@ -542,6 +547,7 @@ For enhanced input UI with better styling and features:
``` ```
You'll need to install dressing.nvim: You'll need to install dressing.nvim:
```lua ```lua
-- With lazy.nvim -- With lazy.nvim
{ "stevearc/dressing.nvim" } { "stevearc/dressing.nvim" }
@@ -568,6 +574,7 @@ For modern, feature-rich input UI:
``` ```
You'll need to install snacks.nvim: You'll need to install snacks.nvim:
```lua ```lua
-- With lazy.nvim -- With lazy.nvim
{ "folke/snacks.nvim" } { "folke/snacks.nvim" }

View File

@@ -60,6 +60,8 @@
"yetone/avante.nvim", "yetone/avante.nvim",
event = "VeryLazy", event = "VeryLazy",
version = false, -- 永远不要将此值设置为 "*"!永远不要! version = false, -- 永远不要将此值设置为 "*"!永远不要!
---@module 'avante'
---@type avante.Config
opts = { opts = {
-- 在此处添加任何选项 -- 在此处添加任何选项
-- 例如 -- 例如

View File

@@ -21,8 +21,10 @@ local M = {}
M._defaults = { M._defaults = {
debug = false, debug = false,
---@alias avante.Mode "agentic" | "legacy" ---@alias avante.Mode "agentic" | "legacy"
---@type avante.Mode
mode = "agentic", mode = "agentic",
---@alias avante.ProviderName "claude" | "openai" | "azure" | "gemini" | "vertex" | "cohere" | "copilot" | "bedrock" | "ollama" | string ---@alias avante.ProviderName "claude" | "openai" | "azure" | "gemini" | "vertex" | "cohere" | "copilot" | "bedrock" | "ollama" | string
---@type avante.ProviderName
provider = "claude", provider = "claude",
-- WARNING: Since auto-suggestions are a high-frequency operation and therefore expensive, -- 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 -- 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, auto_suggestions_provider = nil,
memory_summary_provider = nil, memory_summary_provider = nil,
---@alias Tokenizer "tiktoken" | "hf" ---@alias Tokenizer "tiktoken" | "hf"
---@type Tokenizer
-- Used for counting tokens and encoding text. -- Used for counting tokens and encoding text.
-- By default, we will use tiktoken. -- By default, we will use tiktoken.
-- For most providers that we support we will determine this automatically. -- For most providers that we support we will determine this automatically.
@@ -518,6 +521,7 @@ M._defaults = {
}, },
windows = { windows = {
---@alias AvantePosition "right" | "left" | "top" | "bottom" | "smart" ---@alias AvantePosition "right" | "left" | "top" | "bottom" | "smart"
---@type AvantePosition
position = "right", position = "right",
fillchars = "eob: ", fillchars = "eob: ",
wrap = true, -- similar to vim.o.wrap wrap = true, -- similar to vim.o.wrap
@@ -541,6 +545,7 @@ M._defaults = {
border = { " ", " ", " ", " ", " ", " ", " ", " " }, border = { " ", " ", " ", " ", " ", " ", " ", " " },
start_insert = true, -- Start insert mode when opening the ask window start_insert = true, -- Start insert mode when opening the ask window
---@alias AvanteInitialDiff "ours" | "theirs" ---@alias AvanteInitialDiff "ours" | "theirs"
---@type AvanteInitialDiff
focus_on_apply = "ours", -- which diff to focus after applying focus_on_apply = "ours", -- which diff to focus after applying
}, },
}, },
@@ -569,6 +574,7 @@ M._defaults = {
}, },
selector = { selector = {
---@alias avante.SelectorProvider "native" | "fzf_lua" | "mini_pick" | "snacks" | "telescope" | fun(selector: avante.ui.Selector): nil ---@alias avante.SelectorProvider "native" | "fzf_lua" | "mini_pick" | "snacks" | "telescope" | fun(selector: avante.ui.Selector): nil
---@type avante.SelectorProvider
provider = "native", provider = "native",
provider_opts = {}, provider_opts = {},
exclude_auto_select = {}, -- List of items to exclude from auto selection exclude_auto_select = {}, -- List of items to exclude from auto selection

View File

@@ -1613,6 +1613,7 @@ local function calculate_config_window_position()
end end
end end
---@cast position -"smart", -string
return position return position
end end