feat(nvim): add LSP noise filtering for log and diagnostic handlers

This commit is contained in:
Oliver
2026-03-13 15:12:01 +01:00
parent 768a1d8d43
commit e9952923f6
2 changed files with 28 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ require("olinpin.set")
require("olinpin.lazy")
require("olinpin.remap")
require("olinpin.commands")
require("olinpin.lsp-config")
-- this needs to be set after lazy
vim.o.timeoutlen = 0

View File

@@ -0,0 +1,27 @@
-- LSP error filtering and configuration
-- Filter out noise from LSP logs
local original_handler = vim.lsp.handlers["window/logMessage"]
vim.lsp.handlers["window/logMessage"] = function(err, result, ctx, config)
-- Suppress harper-ls didSave warnings (harmless)
if result and result.message and result.message:match("didSave.*not implemented") then
return
end
-- Call original handler for other messages
if original_handler then
return original_handler(err, result, ctx, config)
end
end
-- Filter publish_diagnostics to exclude minio temp file errors
local original_diagnostics = vim.lsp.handlers["textDocument/publishDiagnostics"]
vim.lsp.handlers["textDocument/publishDiagnostics"] = function(err, result, ctx, config)
if result and result.uri then
if result.uri:match("minio%-data") or result.uri:match("%.minio%.sys") then
return
end
end
if original_diagnostics then
return original_diagnostics(err, result, ctx, config)
end
end