Skip to content

Commit

Permalink
Use Text.find and isJust instead of Text.elem
Browse files Browse the repository at this point in the history
Text.elem is too new even for GHC 8.10
  • Loading branch information
akshaymankar committed Jun 12, 2023
1 parent 974d591 commit 427f7f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/hls-pragmas-plugin/src/Ide/Plugin/Pragmas.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 427f7f7

Please sign in to comment.