From 93f95524a8d0df725db24aac9f25c332370521ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20W=C3=A5linder?= Date: Wed, 5 Nov 2025 20:21:34 +0100 Subject: [PATCH 1/2] Update regex pattern in shouldDropLine Ref: https://github.com/josephsumabat/static-ls/issues/183 --- src/StaticLS/IDE/Diagnostics/ParseGHC.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/StaticLS/IDE/Diagnostics/ParseGHC.hs b/src/StaticLS/IDE/Diagnostics/ParseGHC.hs index eb4453ff..8d42218a 100644 --- a/src/StaticLS/IDE/Diagnostics/ParseGHC.hs +++ b/src/StaticLS/IDE/Diagnostics/ParseGHC.hs @@ -177,7 +177,7 @@ shouldDropLine :: Text -> Bool shouldDropLine t = t == "In the" || t `matches` r1 || t `matches` r2 where r1 = mkRegex [r|^\s*\|$|] - r2 = mkRegex [r|(\d+)?\s*\||] + r2 = mkRegex [r|(\d+)?\s+\|[\s$]+|] split :: Text -> [Message] split = findHeader . T.lines From f912ad9ed28867a3611d661a5b1d6bda22351aab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20W=C3=A5linder?= Date: Wed, 5 Nov 2025 21:10:16 +0100 Subject: [PATCH 2/2] Added BOL check to shouldDropLine bar regexp --- src/StaticLS/IDE/Diagnostics/ParseGHC.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/StaticLS/IDE/Diagnostics/ParseGHC.hs b/src/StaticLS/IDE/Diagnostics/ParseGHC.hs index 8d42218a..5d197396 100644 --- a/src/StaticLS/IDE/Diagnostics/ParseGHC.hs +++ b/src/StaticLS/IDE/Diagnostics/ParseGHC.hs @@ -177,7 +177,7 @@ shouldDropLine :: Text -> Bool shouldDropLine t = t == "In the" || t `matches` r1 || t `matches` r2 where r1 = mkRegex [r|^\s*\|$|] - r2 = mkRegex [r|(\d+)?\s+\|[\s$]+|] + r2 = mkRegex [r|(\d+)?[^\s]+\|[\s$]+|] split :: Text -> [Message] split = findHeader . T.lines