chore: prefer not to use function assignment (#1381)

This commit is contained in:
Peter Cardenas
2025-02-24 20:08:03 -08:00
committed by GitHub
parent a1d1697400
commit afa674c6fd
29 changed files with 571 additions and 147 deletions

View File

@@ -146,7 +146,7 @@ function Selection:create_editing_input()
priority = PRIORITY,
})
local submit_input = function(input)
local function submit_input(input)
local full_response = ""
local start_line = self.selection.range.start.lnum
local finish_line = self.selection.range.finish.lnum
@@ -158,10 +158,10 @@ function Selection:create_editing_input()
self.prompt_input:start_spinner()
---@type AvanteLLMStartCallback
local on_start = function(start_opts) end
local function on_start(start_opts) end
---@type AvanteLLMChunkCallback
local on_chunk = function(chunk)
local function on_chunk(chunk)
full_response = full_response .. chunk
local response_lines_ = vim.split(full_response, "\n")
local response_lines = {}
@@ -186,7 +186,7 @@ function Selection:create_editing_input()
end
---@type AvanteLLMStopCallback
local on_stop = function(stop_opts)
local function on_stop(stop_opts)
if stop_opts.error then
-- NOTE: in Ubuntu 22.04+ you will see this ignorable error from ~/.local/share/nvim/lazy/avante.nvim/lua/avante/llm.lua `on_error = function(err)`, check to avoid showing this error.
if type(stop_opts.error) == "table" and stop_opts.error.exit == nil and stop_opts.error.stderr == "{}" then