feat: remove lint tool and add lsp integration
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
local handler = require("chatgpt_nvim.handler")
|
||||
local lint = require("chatgpt_nvim.tools.lint")
|
||||
local robust_lsp = require("chatgpt_nvim.tools.lsp_robust_diagnostics")
|
||||
|
||||
local M = {}
|
||||
|
||||
local function search_and_replace(original, replacements)
|
||||
-- Basic approach: do a global plain text replace for each entry
|
||||
local updated = original
|
||||
for _, r in ipairs(replacements) do
|
||||
local search_str = r.search or ""
|
||||
@@ -41,15 +40,9 @@ M.run = function(tool_call, conf, prompt_user_tool_accept, is_subpath, read_file
|
||||
msg[#msg+1] = string.format("<final_file_content path=\"%s\">\n%s\n</final_file_content>", path, updated_data)
|
||||
msg[#msg+1] = "\nIMPORTANT: For any future changes to this file, use the final_file_content shown above as your reference.\n"
|
||||
|
||||
-- 2) Lint check if enabled
|
||||
if conf.auto_lint then
|
||||
local output, err = lint.lint_file(path)
|
||||
if output then
|
||||
msg[#msg+1] = "\n--- Lint Results ---\n"
|
||||
msg[#msg+1] = output
|
||||
else
|
||||
msg[#msg+1] = "\n(Lint) " .. (err or "Could not lint this file.")
|
||||
end
|
||||
local diag_str = robust_lsp.lsp_check_file_content(path, updated_data, 3000)
|
||||
msg[#msg+1] = "\n" .. diag_str
|
||||
end
|
||||
|
||||
return table.concat(msg, "")
|
||||
|
||||
Reference in New Issue
Block a user