feat: add auto_check_diagnostics config (#2189)

This commit is contained in:
yetone
2025-06-08 02:00:40 +08:00
committed by GitHub
parent 574b0d37a3
commit 86489ef2be
2 changed files with 2 additions and 1 deletions

View File

@@ -425,6 +425,7 @@ M._defaults = {
auto_focus_on_diff_view = false, auto_focus_on_diff_view = false,
---@type boolean | string[] -- true: auto-approve all tools, false: normal prompts, string[]: auto-approve specific tools by name ---@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_approve_tool_permissions = false, -- Default: show permission prompts for all tools
auto_check_diagnostics = true,
}, },
history = { history = {
max_tokens = 4096, max_tokens = 4096,

View File

@@ -2291,7 +2291,7 @@ function Sidebar:get_history_messages_for_api(opts)
is_dummy = true, 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) local diagnostics = Utils.lsp.get_diagnostics_from_filepath(path)
history_messages = vim.list_extend(history_messages, { history_messages = vim.list_extend(history_messages, {
HistoryMessage:new({ HistoryMessage:new({