From 35f0bc16a5bbcb3df8415b96605e7142293be5d0 Mon Sep 17 00:00:00 2001 From: "Harrison (Harry) Cramer" <32515581+harrisoncramer@users.noreply.github.com> Date: Mon, 18 Dec 2023 17:00:04 -0500 Subject: [PATCH] fixed sign/diagnostic filtering (#150) This was a small diagnostics/signs regression introduced by #147. We were filtering the diagnostics and discussions but then not actually using the filtered data. Facepalm. --- lua/gitlab/actions/discussions/signs.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lua/gitlab/actions/discussions/signs.lua b/lua/gitlab/actions/discussions/signs.lua index cebb04ea..3c5ff01d 100644 --- a/lua/gitlab/actions/discussions/signs.lua +++ b/lua/gitlab/actions/discussions/signs.lua @@ -20,13 +20,13 @@ end ---string for sign name and sign group ( currently there is only one sign needed) ---@param discussions Discussion[] M.refresh_signs = function(discussions) - local diagnostics = M.filter_discussions_for_signs_and_diagnostics(discussions) - if diagnostics == nil then + local filtered_discussions = M.filter_discussions_for_signs_and_diagnostics(discussions) + if filtered_discussions == nil then vim.diagnostic.reset(diagnostics_namespace) return end - local new_signs, old_signs, error = M.parse_signs_from_discussions(discussions) + local new_signs, old_signs, error = M.parse_signs_from_discussions(filtered_discussions) if error ~= nil then vim.notify(error, vim.log.levels.ERROR) return @@ -42,13 +42,13 @@ end M.refresh_diagnostics = function(discussions) -- Keep in mind that diagnostic line numbers use 0-based indexing while line numbers use -- 1-based indexing - local diagnostics = M.filter_discussions_for_signs_and_diagnostics(discussions) - if diagnostics == nil then + local filtered_discussions = M.filter_discussions_for_signs_and_diagnostics(discussions) + if filtered_discussions == nil then vim.diagnostic.reset(diagnostics_namespace) return end - local new_diagnostics, old_diagnostics = M.parse_diagnostics_from_discussions(discussions) + local new_diagnostics, old_diagnostics = M.parse_diagnostics_from_discussions(filtered_discussions) vim.diagnostic.reset(diagnostics_namespace) reviewer.set_diagnostics(