Skip to content

Commit 231ceb2

Browse files
committed
Test cases for exotic identifiers
1 parent 97ef1fa commit 231ceb2

File tree

2 files changed

+111
-0
lines changed

2 files changed

+111
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
module X = {
2+
// ^hov
3+
let \"Foo" = "foo"
4+
}
5+
6+
// let foo = X.
7+
// ^com
8+
9+
module type Y = {
10+
// ^hov
11+
let \"Foo": string
12+
}
13+
14+
type x = {\"Foo": string}
15+
// ^hov
16+
17+
let f = (x: x) => {
18+
// let {} = x
19+
// ^com
20+
ignore(x)
21+
}
22+
23+
let g = (~\"Foo") => \"Foo"
24+
// ^hov
25+
26+
// g(~)
27+
// ^com
28+
29+
module C = {
30+
// ^hov
31+
@react.component
32+
let make = (~\"Foo": option<string>=?) =>
33+
switch \"Foo" {
34+
| Some(foo) => React.string(foo)
35+
| None => React.null
36+
}
37+
}
38+
39+
let _ = <C />
40+
// ^com
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
Hover src/ExoticIdentifiers.res 0:7
2+
{"contents": {"kind": "markdown", "value": "```rescript\nmodule X: {\n let Foo: string\n}\n```"}}
3+
4+
Complete src/ExoticIdentifiers.res 5:15
5+
posCursor:[5:15] posNoWhite:[5:14] Found expr:[5:13->5:15]
6+
Pexp_ident X.:[5:13->5:15]
7+
Completable: Cpath Value[X, ""]
8+
[{
9+
"label": "Foo",
10+
"kind": 12,
11+
"tags": [],
12+
"detail": "string",
13+
"documentation": null
14+
}]
15+
16+
Hover src/ExoticIdentifiers.res 8:12
17+
{"contents": {"kind": "markdown", "value": "```rescript\nmodule type Y = {\n let Foo: string\n}\n```"}}
18+
19+
Hover src/ExoticIdentifiers.res 13:5
20+
{"contents": {"kind": "markdown", "value": "```rescript\ntype x = {\\\"Foo\": string}\n```"}}
21+
22+
Complete src/ExoticIdentifiers.res 17:10
23+
posCursor:[17:10] posNoWhite:[17:9] Found expr:[16:8->20:1]
24+
posCursor:[17:10] posNoWhite:[17:9] Found expr:[17:5->19:11]
25+
posCursor:[17:10] posNoWhite:[17:9] Found pattern:[17:9->17:11]
26+
Completable: Cpattern Value[x]->recordBody
27+
[{
28+
"label": "Foo",
29+
"kind": 5,
30+
"tags": [],
31+
"detail": "Foo: string\n\nx",
32+
"documentation": null
33+
}]
34+
35+
Hover src/ExoticIdentifiers.res 22:4
36+
{"contents": {"kind": "markdown", "value": "```rescript\n(~Foo: 'a) => 'a\n```"}}
37+
38+
Complete src/ExoticIdentifiers.res 25:6
39+
posCursor:[25:6] posNoWhite:[25:5] Found expr:[25:3->25:7]
40+
Pexp_apply ...[25:3->25:4] ()
41+
Completable: CnamedArg(Value[g], "", [])
42+
Found type for function (~Foo: 'a) => 'a
43+
[{
44+
"label": "Foo",
45+
"kind": 4,
46+
"tags": [],
47+
"detail": "'a",
48+
"documentation": null
49+
}]
50+
51+
Hover src/ExoticIdentifiers.res 28:7
52+
{"contents": {"kind": "markdown", "value": "```rescript\nmodule C: {\n let makeProps: (\n ~Foo: string=?,\n ~key: string=?,\n unit,\n) => {\"Foo\": option<string>}\n let make: {\"Foo\": option<string>} => React.element\n}\n```"}}
53+
54+
Complete src/ExoticIdentifiers.res 38:11
55+
posCursor:[38:11] posNoWhite:[38:9] Found expr:[38:9->38:13]
56+
JSX <C:[38:9->38:10] > _children:38:11
57+
Completable: Cjsx([C], "", [])
58+
[{
59+
"label": "Foo",
60+
"kind": 4,
61+
"tags": [],
62+
"detail": "option<string>",
63+
"documentation": null
64+
}, {
65+
"label": "key",
66+
"kind": 4,
67+
"tags": [],
68+
"detail": "string",
69+
"documentation": null
70+
}]
71+

0 commit comments

Comments
 (0)