From 86489ef2bef35881d3761e84e88447db28f2dcc3 Mon Sep 17 00:00:00 2001 From: yetone Date: Sun, 8 Jun 2025 02:00:40 +0800 Subject: [PATCH] feat: add auto_check_diagnostics config (#2189) --- lua/avante/config.lua | 1 + lua/avante/sidebar.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/avante/config.lua b/lua/avante/config.lua index 40b40db..9ee0d09 100644 --- a/lua/avante/config.lua +++ b/lua/avante/config.lua @@ -425,6 +425,7 @@ M._defaults = { auto_focus_on_diff_view = false, ---@type boolean | string[] -- true: auto-approve all tools, false: normal prompts, string[]: auto-approve specific tools by name auto_approve_tool_permissions = false, -- Default: show permission prompts for all tools + auto_check_diagnostics = true, }, history = { max_tokens = 4096, diff --git a/lua/avante/sidebar.lua b/lua/avante/sidebar.lua index 340ef20..ef48469 100644 --- a/lua/avante/sidebar.lua +++ b/lua/avante/sidebar.lua @@ -2291,7 +2291,7 @@ function Sidebar:get_history_messages_for_api(opts) is_dummy = true, }), }) - if last_modified_files[uniformed_path] == idx then + if last_modified_files[uniformed_path] == idx and Config.behaviour.auto_check_diagnostics then local diagnostics = Utils.lsp.get_diagnostics_from_filepath(path) history_messages = vim.list_extend(history_messages, { HistoryMessage:new({