File tree 2 files changed +13
-1
lines changed
plugins/hls-pragmas-plugin
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
163
163
result <$> VFS. getCompletionPrefix position cnts
164
164
where
165
165
result (Just pfix)
166
- | " {-# LANGUAGE " `T.isPrefixOf` VFS. fullLine pfix
166
+ | " {-# language " `T.isPrefixOf` T. toLower ( VFS. fullLine pfix)
167
167
= J. List $ map buildCompletion
168
168
(Fuzzy. simpleFilter (VFS. prefixText pfix) allPragmas)
169
169
| " {-# options_ghc" `T.isPrefixOf` T. toLower (VFS. fullLine pfix)
Original file line number Diff line number Diff line change @@ -258,6 +258,18 @@ completionTests =
258
258
item ^. L. label @?= " OverloadedStrings"
259
259
item ^. L. kind @?= Just CiKeyword
260
260
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
+
261
273
, testCase " completes the Strict language extension" $ runSessionWithServer pragmasPlugin testDataDir $ do
262
274
doc <- openDoc " Completion.hs" " haskell"
263
275
_ <- waitForDiagnostics
You can’t perform that action at this time.
0 commit comments