Skip to content

Commit 279ba38

Browse files
committed
add array test
1 parent 28e0f5e commit 279ba38

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed

analysis/tests/src/TypeAtPosCompletion.res

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,8 @@ let x = One(
1818
// ^com
1919
},
2020
)
21+
22+
let arr = [
23+
optRecord,
24+
// ^com
25+
]

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

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,81 @@ ContextPath CTypeAtPos()
4141
"documentation": null
4242
}]
4343

44+
Complete src/TypeAtPosCompletion.res 22:12
45+
posCursor:[22:12] posNoWhite:[22:11] Found expr:[21:10->24:1]
46+
Completable: Cexpression CTypeAtPos()->array
47+
Package opens Pervasives.JsxModules.place holder
48+
Resolved opens 1 pervasives
49+
ContextPath CTypeAtPos()
50+
[{
51+
"label": "{}",
52+
"kind": 12,
53+
"tags": [],
54+
"detail": "optRecord",
55+
"documentation": null,
56+
"sortText": "A",
57+
"insertText": "{$0}",
58+
"insertTextFormat": 2
59+
}]
60+
61+
Complete src/TypeAtPosCompletion.res 38:5
62+
posCursor:[38:5] posNoWhite:[38:4] Found expr:[37:12->0:-1]
63+
Completable: Cpath Value[Belt, Option, getExn](Nolabel)->
64+
Package opens Pervasives.JsxModules.place holder
65+
Resolved opens 1 pervasives
66+
ContextPath Value[Belt, Option, getExn](Nolabel)->
67+
ContextPath Value[Belt, Option, getExn](Nolabel)
68+
ContextPath Value[Belt, Option, getExn]
69+
Path Belt.Option.getExn
70+
CPPipe env:TypeAtPosCompletion envFromCompletionItem:Belt_Option
71+
Path Belt.Int.
72+
[{
73+
"label": "Belt.Int.fromString",
74+
"kind": 12,
75+
"tags": [],
76+
"detail": "string => option<int>",
77+
"documentation": {"kind": "markdown", "value": "\n Converts a given `string` to an `int`. Returns `Some(int)` when the input is a number, `None` otherwise.\n\n ```res example\n Js.log(Belt.Int.fromString(\"1\") === Some(1)) /* true */\n ```\n"}
78+
}, {
79+
"label": "Belt.Int.*",
80+
"kind": 12,
81+
"tags": [],
82+
"detail": "(int, int) => int",
83+
"documentation": {"kind": "markdown", "value": "\n Multiplication of two `int` values. Same as the multiplication from `Pervasives`.\n\n ```res example\n open Belt.Int\n Js.log(2 * 2 === 4) /* true */\n ```\n"}
84+
}, {
85+
"label": "Belt.Int./",
86+
"kind": 12,
87+
"tags": [],
88+
"detail": "(int, int) => int",
89+
"documentation": {"kind": "markdown", "value": "\n Division of two `int` values. Same as the division from `Pervasives`.\n\n ```res example\n open Belt.Int\n Js.log(4 / 2 === 2); /* true */\n ```\n"}
90+
}, {
91+
"label": "Belt.Int.toString",
92+
"kind": 12,
93+
"tags": [],
94+
"detail": "int => string",
95+
"documentation": {"kind": "markdown", "value": "\n Converts a given `int` to a `string`. Uses the JavaScript `String` constructor under the hood.\n\n ```res example\n Js.log(Belt.Int.toString(1) === \"1\") /* true */\n ```\n"}
96+
}, {
97+
"label": "Belt.Int.toFloat",
98+
"kind": 12,
99+
"tags": [],
100+
"detail": "int => float",
101+
"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"}
102+
}, {
103+
"label": "Belt.Int.fromFloat",
104+
"kind": 12,
105+
"tags": [],
106+
"detail": "float => int",
107+
"documentation": {"kind": "markdown", "value": "\n Converts a given `float` to an `int`.\n\n ```res example\n Js.log(Belt.Int.fromFloat(1.0) === 1) /* true */\n ```\n"}
108+
}, {
109+
"label": "Belt.Int.-",
110+
"kind": 12,
111+
"tags": [],
112+
"detail": "(int, int) => int",
113+
"documentation": {"kind": "markdown", "value": "\n Subtraction of two `int` values. Same as the subtraction from `Pervasives`.\n\n ```res example\n open Belt.Int\n Js.log(2 - 1 === 1) /* true */\n ```\n"}
114+
}, {
115+
"label": "Belt.Int.+",
116+
"kind": 12,
117+
"tags": [],
118+
"detail": "(int, int) => int",
119+
"documentation": {"kind": "markdown", "value": "\n Addition of two `int` values. Same as the addition from `Pervasives`.\n\n ```res example\n open Belt.Int\n Js.log(2 + 2 === 4) /* true */\n ```\n"}
120+
}]
121+

0 commit comments

Comments
 (0)