From 427f7f72ec9d477c0e59e78f24944c83325f981b Mon Sep 17 00:00:00 2001 From: Akshay Mankar Date: Mon, 12 Jun 2023 10:48:16 +0200 Subject: [PATCH] Use Text.find and isJust instead of Text.elem Text.elem is too new even for GHC 8.10 --- plugins/hls-pragmas-plugin/src/Ide/Plugin/Pragmas.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/hls-pragmas-plugin/src/Ide/Plugin/Pragmas.hs b/plugins/hls-pragmas-plugin/src/Ide/Plugin/Pragmas.hs index 930c4e0b039..9eb811a15d6 100644 --- a/plugins/hls-pragmas-plugin/src/Ide/Plugin/Pragmas.hs +++ b/plugins/hls-pragmas-plugin/src/Ide/Plugin/Pragmas.hs @@ -19,7 +19,7 @@ import Control.Lens hiding (List) import Control.Monad.IO.Class (MonadIO (liftIO)) import qualified Data.HashMap.Strict as H import Data.List.Extra (nubOrdOn) -import Data.Maybe (catMaybes) +import Data.Maybe (catMaybes, isJust) import qualified Data.Text as T import Development.IDE import Development.IDE.GHC.Compat @@ -203,7 +203,7 @@ completion _ide _ complParams = do , Fuzzy.test word matcher , (appearWhere == NewLine && line == word) || (appearWhere == CanInline && line /= word) - || (T.elem ' ' matcher && appearWhere == NewLine && Fuzzy.test line matcher) + || (isJust (T.find (== ' ') matcher) && appearWhere == NewLine && Fuzzy.test line matcher) ] where line = T.toLower $ VFS.fullLine pfix