File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
plugins/hls-pragmas-plugin Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ completion _ide _ complParams = do
163163 result <$> VFS. getCompletionPrefix position cnts
164164 where
165165 result (Just pfix)
166- | " {-# LANGUAGE " `T.isPrefixOf` VFS. fullLine pfix
166+ | " {-# language " `T.isPrefixOf` T. toLower ( VFS. fullLine pfix)
167167 = J. List $ map buildCompletion
168168 (Fuzzy. simpleFilter (VFS. prefixText pfix) allPragmas)
169169 | " {-# options_ghc" `T.isPrefixOf` T. toLower (VFS. fullLine pfix)
Original file line number Diff line number Diff line change @@ -258,6 +258,18 @@ completionTests =
258258 item ^. L. label @?= " OverloadedStrings"
259259 item ^. L. kind @?= Just CiKeyword
260260
261+
262+ , testCase " completes language extensions case insensitive" $ runSessionWithServer pragmasPlugin testDataDir $ do
263+ doc <- openDoc " Completion.hs" " haskell"
264+ _ <- waitForDiagnostics
265+ let te = TextEdit (Range (Position 0 4 ) (Position 0 34 )) " lAnGuaGe Overloaded"
266+ _ <- applyEdit doc te
267+ compls <- getCompletions doc (Position 0 24 )
268+ let item = head $ filter ((== " OverloadedStrings" ) . (^. L. label)) compls
269+ liftIO $ do
270+ item ^. L. label @?= " OverloadedStrings"
271+ item ^. L. kind @?= Just CiKeyword
272+
261273 , testCase " completes the Strict language extension" $ runSessionWithServer pragmasPlugin testDataDir $ do
262274 doc <- openDoc " Completion.hs" " haskell"
263275 _ <- waitForDiagnostics
You can’t perform that action at this time.
0 commit comments