fix: set default auto suggestions provider to nil (#1951)

This commit is contained in:
yetone
2025-05-01 02:50:01 +08:00
committed by GitHub
parent 99a2e35ff3
commit 32ca1ed38e
4 changed files with 7 additions and 6 deletions

View File

@@ -26,7 +26,7 @@ M._defaults = {
-- 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
-- Of course, you can reduce the request frequency by increasing `suggestion.debounce`.
auto_suggestions_provider = "claude",
auto_suggestions_provider = nil,
cursor_applying_provider = nil,
memory_summary_provider = nil,
---@alias Tokenizer "tiktoken" | "hf"

View File

@@ -207,12 +207,14 @@ function M.setup()
---@type AvanteProviderFunctor | AvanteBedrockProviderFunctor
local provider = M[Config.provider]
local auto_suggestions_provider = M[Config.auto_suggestions_provider]
E.setup({ provider = provider })
if auto_suggestions_provider and auto_suggestions_provider ~= provider then
E.setup({ provider = auto_suggestions_provider })
if Config.auto_suggestions_provider then
local auto_suggestions_provider = M[Config.auto_suggestions_provider]
if auto_suggestions_provider and auto_suggestions_provider ~= provider then
E.setup({ provider = auto_suggestions_provider })
end
end
if Config.memory_summary_provider then

View File

@@ -72,7 +72,7 @@ function Suggestion:suggest()
local full_response = ""
local provider = Providers[Config.auto_suggestions_provider]
local provider = Providers[Config.auto_suggestions_provider or Config.provider]
---@type AvanteLLMMessage[]
local history_messages = {

View File

@@ -36,7 +36,6 @@ function M.parse(key_name, override)
Utils.debug("running command:", cmd)
local exit_codes = { 0 }
local ok, job_or_err = pcall(vim.system, cmd, { text = true }, function(result)
Utils.debug("command result:", result)
local code = result.code
local stderr = result.stderr or ""
local stdout = result.stdout and vim.split(result.stdout, "\n") or {}