Skip to content

Commit d447549

Browse files
committed
Add tests showing over on components not working in interface files.
1 parent 170dcc8 commit d447549

File tree

5 files changed

+32
-16
lines changed

5 files changed

+32
-16
lines changed

analysis/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ function exp {
22
echo "$(dirname $1)/expected/$(basename $1).txt"
33
}
44

5-
for file in tests/src/*.res; do
5+
for file in tests/src/*.res[i]; do
66
./run.exe test $file &> $(exp $file)
77
done
88

analysis/tests/src/Jsx.res

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
module M = {
22
@react.component
3-
let make = (~first, ~fun="", ~second="") => React.string(first ++ fun++ second)
3+
let make = (~first, ~fun="", ~second="") => React.string(first ++ fun ++ second)
44
}
55

6-
let d = <M first="abc" />
6+
let _ = <M first="abc" />
77
// ^def
88

99
//^com <M second=fi
1010

11-
1211
//^com <M second="abc" f
1312

1413
//^com let e = <M
14+
15+
@react.component
16+
let make = (~first) => React.string(first)
17+
18+
let y = 44

analysis/tests/src/Jsx.resi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@react.component
2+
let make: (~first: string) => React.element
3+
// ^hov
4+
5+
let y : int
6+
// ^hov

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,26 @@ Complete tests/src/Jsx.res 7:2
99
"detail": "string",
1010
"documentation": null
1111
}, {
12-
"label": "first",
12+
"label": "second",
1313
"kind": 4,
1414
"tags": [],
15-
"detail": "string",
15+
"detail": "option<string>",
1616
"documentation": null
1717
}, {
18-
"label": "fun",
18+
"label": "first",
1919
"kind": 4,
2020
"tags": [],
21-
"detail": "option<string>",
21+
"detail": "string",
2222
"documentation": null
2323
}, {
24-
"label": "second",
24+
"label": "fun",
2525
"kind": 4,
2626
"tags": [],
2727
"detail": "option<string>",
2828
"documentation": null
2929
}]
3030

31-
Complete tests/src/Jsx.res 10:2
31+
Complete tests/src/Jsx.res 9:2
3232
[{
3333
"label": "key",
3434
"kind": 4,
@@ -49,27 +49,27 @@ Complete tests/src/Jsx.res 10:2
4949
"documentation": null
5050
}]
5151

52-
Complete tests/src/Jsx.res 12:2
52+
Complete tests/src/Jsx.res 11:2
5353
[{
5454
"label": "key",
5555
"kind": 4,
5656
"tags": [],
5757
"detail": "string",
5858
"documentation": null
5959
}, {
60-
"label": "first",
60+
"label": "second",
6161
"kind": 4,
6262
"tags": [],
63-
"detail": "string",
63+
"detail": "option<string>",
6464
"documentation": null
6565
}, {
66-
"label": "fun",
66+
"label": "first",
6767
"kind": 4,
6868
"tags": [],
69-
"detail": "option<string>",
69+
"detail": "string",
7070
"documentation": null
7171
}, {
72-
"label": "second",
72+
"label": "fun",
7373
"kind": 4,
7474
"tags": [],
7575
"detail": "option<string>",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Hover tests/src/Jsx.resi 1:4
2+
null
3+
4+
Hover tests/src/Jsx.resi 4:4
5+
{"contents": "```rescript\nint\n```"}
6+

0 commit comments

Comments
 (0)