Skip to content

Commit b403ca6

Browse files
committed
add broken test for pipe completion on aliased types
1 parent 02a2c53 commit b403ca6

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

analysis/tests/src/CompletionPipeChain.res

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,14 @@ let _ = [123]->Js.Array2.forEach(v => Js.log(v))
6262
let _ = [123]->Belt.Array.reduce(0, (acc, curr) => acc + curr)
6363
// ->t
6464
// ^com
65+
66+
type aliasedType = CompletionSupport.Test.t
67+
68+
let aliased: aliasedType = {name: 123}
69+
let notAliased: CompletionSupport.Test.t = {name: 123}
70+
71+
// aliased->
72+
// ^com
73+
74+
// notAliased->
75+
// ^com

analysis/tests/src/expected/CompletionPipeChain.res.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,3 +256,31 @@ Completable: Cpath Value[Belt, Array, reduce](Nolabel, Nolabel, Nolabel)->t
256256
"documentation": {"kind": "markdown", "value": "\n Converts a given `int` to a `float`.\n\n ```res example\n Js.log(Belt.Int.toFloat(1) === 1.0) /* true */\n ```\n"}
257257
}]
258258

259+
Complete src/CompletionPipeChain.res 70:12
260+
posCursor:[70:12] posNoWhite:[70:11] Found expr:[70:3->0:-1]
261+
Completable: Cpath Value[aliased]->
262+
[]
263+
264+
Complete src/CompletionPipeChain.res 73:15
265+
posCursor:[73:15] posNoWhite:[73:14] Found expr:[73:3->0:-1]
266+
Completable: Cpath Value[notAliased]->
267+
[{
268+
"label": "CompletionSupport.Test.add",
269+
"kind": 12,
270+
"tags": [],
271+
"detail": "t => int",
272+
"documentation": null
273+
}, {
274+
"label": "CompletionSupport.Test.addSelf",
275+
"kind": 12,
276+
"tags": [],
277+
"detail": "t => t",
278+
"documentation": null
279+
}, {
280+
"label": "CompletionSupport.Test.make",
281+
"kind": 12,
282+
"tags": [],
283+
"detail": "int => t",
284+
"documentation": null
285+
}]
286+

0 commit comments

Comments
 (0)