Skip to content

Commit 03891aa

Browse files
Update completion tests to reflect the renewed support for snippets in ghcide 6.0.
1 parent 38849ff commit 03891aa

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/functional/Completion.hs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ tests = testGroup "completions" [
2929
item ^. label @?= "putStrLn"
3030
item ^. kind @?= Just CiFunction
3131
item ^. detail @?= Just ":: String -> IO ()"
32-
item ^. insertTextFormat @?= Just PlainText
33-
item ^. insertText @?= Nothing
32+
item ^. insertTextFormat @?= Just Snippet
33+
item ^. insertText @?= Just "putStrLn ${1:String}"
3434

3535
, ignoreTestBecause "no support for itemCompletion/resolve requests"
3636
$ testCase "itemCompletion/resolve works" $ runSession hlsCommand fullCaps "test/testdata/completion" $ do
@@ -105,8 +105,8 @@ tests = testGroup "completions" [
105105
liftIO $ do
106106
item ^. label @?= "LANGUAGE"
107107
item ^. kind @?= Just CiKeyword
108-
item ^. insertTextFormat @?= Just PlainText
109-
item ^. insertText @?= Nothing
108+
item ^. insertTextFormat @?= Just Snippet
109+
item ^. insertText @?= Just "LANGUAGE ${1:extension} #-}"
110110

111111
, testCase "completes pragmas no close" $ runSession hlsCommand fullCaps "test/testdata/completion" $ do
112112
doc <- openDoc "Completion.hs" "haskell"
@@ -120,8 +120,8 @@ tests = testGroup "completions" [
120120
liftIO $ do
121121
item ^. label @?= "LANGUAGE"
122122
item ^. kind @?= Just CiKeyword
123-
item ^. insertTextFormat @?= Just PlainText
124-
item ^. insertText @?= Nothing
123+
item ^. insertTextFormat @?= Just Snippet
124+
item ^. insertText @?= Just "LANGUAGE ${1:extension}"
125125

126126
, testCase "completes options pragma" $ runSession hlsCommand fullCaps "test/testdata/completion" $ do
127127
doc <- openDoc "Completion.hs" "haskell"
@@ -135,8 +135,8 @@ tests = testGroup "completions" [
135135
liftIO $ do
136136
item ^. label @?= "OPTIONS_GHC"
137137
item ^. kind @?= Just CiKeyword
138-
item ^. insertTextFormat @?= Just PlainText
139-
item ^. insertText @?= Nothing
138+
item ^. insertTextFormat @?= Just Snippet
139+
item ^. insertText @?= Just "OPTIONS_GHC -${1:option} #-}"
140140

141141
, testCase "completes ghc options pragma values" $ runSession hlsCommand fullCaps "test/testdata/completion" $ do
142142
doc <- openDoc "Completion.hs" "haskell"

0 commit comments

Comments
 (0)