fix: set default auto suggestions provider to nil (#1951)
This commit is contained in:
@@ -26,7 +26,7 @@ M._defaults = {
|
|||||||
-- 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
|
||||||
-- Of course, you can reduce the request frequency by increasing `suggestion.debounce`.
|
-- Of course, you can reduce the request frequency by increasing `suggestion.debounce`.
|
||||||
auto_suggestions_provider = "claude",
|
auto_suggestions_provider = nil,
|
||||||
cursor_applying_provider = nil,
|
cursor_applying_provider = nil,
|
||||||
memory_summary_provider = nil,
|
memory_summary_provider = nil,
|
||||||
---@alias Tokenizer "tiktoken" | "hf"
|
---@alias Tokenizer "tiktoken" | "hf"
|
||||||
|
|||||||
@@ -207,13 +207,15 @@ function M.setup()
|
|||||||
|
|
||||||
---@type AvanteProviderFunctor | AvanteBedrockProviderFunctor
|
---@type AvanteProviderFunctor | AvanteBedrockProviderFunctor
|
||||||
local provider = M[Config.provider]
|
local provider = M[Config.provider]
|
||||||
local auto_suggestions_provider = M[Config.auto_suggestions_provider]
|
|
||||||
|
|
||||||
E.setup({ provider = provider })
|
E.setup({ provider = 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
|
if auto_suggestions_provider and auto_suggestions_provider ~= provider then
|
||||||
E.setup({ provider = auto_suggestions_provider })
|
E.setup({ provider = auto_suggestions_provider })
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if Config.memory_summary_provider then
|
if Config.memory_summary_provider then
|
||||||
local memory_summary_provider = M[Config.memory_summary_provider]
|
local memory_summary_provider = M[Config.memory_summary_provider]
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ function Suggestion:suggest()
|
|||||||
|
|
||||||
local full_response = ""
|
local full_response = ""
|
||||||
|
|
||||||
local provider = Providers[Config.auto_suggestions_provider]
|
local provider = Providers[Config.auto_suggestions_provider or Config.provider]
|
||||||
|
|
||||||
---@type AvanteLLMMessage[]
|
---@type AvanteLLMMessage[]
|
||||||
local history_messages = {
|
local history_messages = {
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ function M.parse(key_name, override)
|
|||||||
Utils.debug("running command:", cmd)
|
Utils.debug("running command:", cmd)
|
||||||
local exit_codes = { 0 }
|
local exit_codes = { 0 }
|
||||||
local ok, job_or_err = pcall(vim.system, cmd, { text = true }, function(result)
|
local ok, job_or_err = pcall(vim.system, cmd, { text = true }, function(result)
|
||||||
Utils.debug("command result:", result)
|
|
||||||
local code = result.code
|
local code = result.code
|
||||||
local stderr = result.stderr or ""
|
local stderr = result.stderr or ""
|
||||||
local stdout = result.stdout and vim.split(result.stdout, "\n") or {}
|
local stdout = result.stdout and vim.split(result.stdout, "\n") or {}
|
||||||
|
|||||||
Reference in New Issue
Block a user