From 876246b9ae9acc83318e21e0b05ba90937cf71c6 Mon Sep 17 00:00:00 2001 From: yetone Date: Mon, 24 Feb 2025 22:04:44 +0800 Subject: [PATCH] fix: the enabled function of the llm tool was not called (#1374) --- lua/avante/llm_tools.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lua/avante/llm_tools.lua b/lua/avante/llm_tools.lua index 561ef50..4d49cf8 100644 --- a/lua/avante/llm_tools.lua +++ b/lua/avante/llm_tools.lua @@ -549,7 +549,18 @@ function M.python(opts, on_log) end ---@return AvanteLLMTool[] -function M.get_tools() return M._tools end +function M.get_tools() + return vim + .iter(M._tools) + :filter(function(tool) + if tool.enabled == nil then + return true + else + return tool.enabled() + end + end) + :totable() +end ---@type AvanteLLMTool[] M._tools = {