From fb3206fe1225b77e43c75a4ebec892595f6c4c94 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 9 Jul 2024 22:00:00 +0100 Subject: [PATCH] Add comment --- lua/opdavies/lsp/handlers.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/opdavies/lsp/handlers.lua b/lua/opdavies/lsp/handlers.lua index 5c0c235..e44e86a 100644 --- a/lua/opdavies/lsp/handlers.lua +++ b/lua/opdavies/lsp/handlers.lua @@ -53,6 +53,9 @@ M.on_publish_diagnostics = function(_, result, ctx, config) "Unknown at rule @tailwind", } + -- For each diagnostic, ensure its mesages doesn't match one I want to + -- ignore before adding it to the result. If it matches, don't add it to the + -- result and it won't be shown. for _, diagnostic in ipairs(result.diagnostics) do if not should_remove_diagnostic(messages_to_filter, diagnostic.message) then table.insert(filtered_diagnostics, diagnostic)