@@ -20,7 +20,7 @@ tests = testGroup "completions" [
20
20
_ <- applyEdit doc te
21
21
22
22
compls <- getCompletions doc (Position 5 9 )
23
- item <- getCopletionByLabel " putStrLn" compls
23
+ item <- getCompletionByLabel " putStrLn" compls
24
24
liftIO $ do
25
25
item ^. label @?= " putStrLn"
26
26
item ^. kind @?= Just CiFunction
@@ -36,7 +36,7 @@ tests = testGroup "completions" [
36
36
_ <- applyEdit doc te
37
37
38
38
compls <- getCompletions doc (Position 5 9 )
39
- item <- getCopletionByLabel " putStrLn" compls
39
+ item <- getCompletionByLabel " putStrLn" compls
40
40
resolvedRes <- request SCompletionItemResolve item
41
41
let eResolved = resolvedRes ^. result
42
42
case eResolved of
@@ -57,7 +57,7 @@ tests = testGroup "completions" [
57
57
_ <- applyEdit doc te
58
58
59
59
compls <- getCompletions doc (Position 1 23 )
60
- item <- getCopletionByLabel " Maybe" compls
60
+ item <- getCompletionByLabel " Maybe" compls
61
61
liftIO $ do
62
62
item ^. label @?= " Maybe"
63
63
item ^. detail @?= Just " Data.Maybe"
@@ -72,7 +72,7 @@ tests = testGroup "completions" [
72
72
_ <- applyEdit doc te
73
73
74
74
compls <- getCompletions doc (Position 2 24 )
75
- item <- getCopletionByLabel " List" compls
75
+ item <- getCompletionByLabel " List" compls
76
76
liftIO $ do
77
77
item ^. label @?= " List"
78
78
item ^. detail @?= Just " Data.List"
@@ -92,7 +92,7 @@ tests = testGroup "completions" [
92
92
_ <- applyEdit doc te
93
93
94
94
compls <- getCompletions doc (Position 5 4 )
95
- item <- getCopletionByLabel " accessor" compls
95
+ item <- getCompletionByLabel " accessor" compls
96
96
liftIO $ do
97
97
item ^. label @?= " accessor"
98
98
item ^. kind @?= Just CiFunction
@@ -102,7 +102,7 @@ tests = testGroup "completions" [
102
102
let te = TextEdit (Range (Position 5 7 ) (Position 5 9 )) " id"
103
103
_ <- applyEdit doc te
104
104
compls <- getCompletions doc (Position 5 9 )
105
- item <- getCopletionByLabel " id" compls
105
+ item <- getCompletionByLabel " id" compls
106
106
liftIO $ do
107
107
item ^. detail @?= Just " :: a -> a"
108
108
@@ -112,7 +112,7 @@ tests = testGroup "completions" [
112
112
let te = TextEdit (Range (Position 5 7 ) (Position 5 24 )) " flip"
113
113
_ <- applyEdit doc te
114
114
compls <- getCompletions doc (Position 5 11 )
115
- item <- getCopletionByLabel " flip" compls
115
+ item <- getCompletionByLabel " flip" compls
116
116
liftIO $
117
117
item ^. detail @?= Just " :: (a -> b -> c) -> b -> a -> c"
118
118
@@ -129,7 +129,7 @@ tests = testGroup "completions" [
129
129
_ <- applyEdit doc te
130
130
131
131
compls <- getCompletions doc (Position 0 31 )
132
- item <- getCopletionByLabel " Alternative" compls
132
+ item <- getCompletionByLabel " Alternative" compls
133
133
liftIO $ do
134
134
item ^. label @?= " Alternative"
135
135
item ^. kind @?= Just CiFunction
@@ -142,7 +142,7 @@ tests = testGroup "completions" [
142
142
_ <- applyEdit doc te
143
143
144
144
compls <- getCompletions doc (Position 0 41 )
145
- item <- getCopletionByLabel " liftA" compls
145
+ item <- getCompletionByLabel " liftA" compls
146
146
liftIO $ do
147
147
item ^. label @?= " liftA"
148
148
item ^. kind @?= Just CiFunction
@@ -160,7 +160,7 @@ snippetTests = testGroup "snippets" [
160
160
_ <- applyEdit doc te
161
161
162
162
compls <- getCompletions doc (Position 5 14 )
163
- item <- getCopletionByLabel " Nothing" compls
163
+ item <- getCompletionByLabel " Nothing" compls
164
164
liftIO $ do
165
165
item ^. insertTextFormat @?= Just Snippet
166
166
item ^. insertText @?= Just " Nothing "
@@ -172,7 +172,7 @@ snippetTests = testGroup "snippets" [
172
172
_ <- applyEdit doc te
173
173
174
174
compls <- getCompletions doc (Position 5 11 )
175
- item <- getCopletionByLabel " foldl" compls
175
+ item <- getCompletionByLabel " foldl" compls
176
176
liftIO $ do
177
177
item ^. label @?= " foldl"
178
178
item ^. kind @?= Just CiFunction
@@ -186,7 +186,7 @@ snippetTests = testGroup "snippets" [
186
186
_ <- applyEdit doc te
187
187
188
188
compls <- getCompletions doc (Position 5 11 )
189
- item <- getCopletionByLabel " mapM" compls
189
+ item <- getCompletionByLabel " mapM" compls
190
190
liftIO $ do
191
191
item ^. label @?= " mapM"
192
192
item ^. kind @?= Just CiFunction
@@ -200,7 +200,7 @@ snippetTests = testGroup "snippets" [
200
200
_ <- applyEdit doc te
201
201
202
202
compls <- getCompletions doc (Position 5 18 )
203
- item <- getCopletionByLabel " filter" compls
203
+ item <- getCompletionByLabel " filter" compls
204
204
liftIO $ do
205
205
item ^. label @?= " filter"
206
206
item ^. kind @?= Just CiFunction
@@ -214,7 +214,7 @@ snippetTests = testGroup "snippets" [
214
214
_ <- applyEdit doc te
215
215
216
216
compls <- getCompletions doc (Position 5 18 )
217
- item <- getCopletionByLabel " filter" compls
217
+ item <- getCompletionByLabel " filter" compls
218
218
liftIO $ do
219
219
item ^. label @?= " filter"
220
220
item ^. kind @?= Just CiFunction
@@ -228,7 +228,7 @@ snippetTests = testGroup "snippets" [
228
228
_ <- applyEdit doc te
229
229
230
230
compls <- getCompletions doc (Position 5 29 )
231
- item <- getCopletionByLabel " intersperse" compls
231
+ item <- getCompletionByLabel " intersperse" compls
232
232
liftIO $ do
233
233
item ^. label @?= " intersperse"
234
234
item ^. kind @?= Just CiFunction
@@ -242,7 +242,7 @@ snippetTests = testGroup "snippets" [
242
242
_ <- applyEdit doc te
243
243
244
244
compls <- getCompletions doc (Position 5 29 )
245
- item <- getCopletionByLabel " intersperse" compls
245
+ item <- getCompletionByLabel " intersperse" compls
246
246
liftIO $ do
247
247
item ^. label @?= " intersperse"
248
248
item ^. kind @?= Just CiFunction
@@ -282,7 +282,7 @@ snippetTests = testGroup "snippets" [
282
282
_ <- applyEdit doc te
283
283
284
284
compls <- getCompletions doc (Position 5 11 )
285
- item <- getCopletionByLabel " foldl" compls
285
+ item <- getCompletionByLabel " foldl" compls
286
286
liftIO $ do
287
287
item ^. label @?= " foldl"
288
288
item ^. kind @?= Just CiFunction
@@ -339,8 +339,8 @@ compls `shouldNotContainCompl` lbl =
339
339
all ((/= lbl) . (^. label)) compls
340
340
@? " Should not contain completion: " ++ show lbl
341
341
342
- getCopletionByLabel :: T. Text -> [CompletionItem ] -> Session CompletionItem
343
- getCopletionByLabel lbl compls =
342
+ getCompletionByLabel :: T. Text -> [CompletionItem ] -> Session CompletionItem
343
+ getCompletionByLabel lbl compls =
344
344
case find (\ c -> c ^. label == lbl) compls of
345
345
Just c -> pure c
346
346
Nothing ->
0 commit comments