Skip to content

Commit 28e0f5e

Browse files
committed
move TypeAtPos tests to own file
1 parent 644dca1 commit 28e0f5e

File tree

6 files changed

+77
-66
lines changed

6 files changed

+77
-66
lines changed

analysis/tests/src/RecordCompletion.res

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,3 @@ let n = {R.name: ""}
2222

2323
// n.R. xx
2424
// ^com
25-
26-
type optRecord = {
27-
name: string,
28-
age?: int,
29-
online?: bool,
30-
}
31-
32-
let optRecord = {
33-
name: "Hello",
34-
// ^com
35-
}
36-
37-
type someVariant = One(int, optRecord)
38-
39-
let x = One(
40-
1,
41-
{
42-
name: "What",
43-
// ^com
44-
},
45-
)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
type optRecord = {
2+
name: string,
3+
age?: int,
4+
online?: bool,
5+
}
6+
7+
let optRecord = {
8+
name: "Hello",
9+
// ^com
10+
}
11+
12+
type someVariant = One(int, optRecord)
13+
14+
let x = One(
15+
1,
16+
{
17+
name: "What",
18+
// ^com
19+
},
20+
)

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,6 +1764,12 @@ Path T
17641764
"tags": [],
17651765
"detail": "file module",
17661766
"documentation": null
1767+
}, {
1768+
"label": "TypeAtPosCompletion",
1769+
"kind": 9,
1770+
"tags": [],
1771+
"detail": "file module",
1772+
"documentation": null
17671773
}, {
17681774
"label": "TypeDefinition",
17691775
"kind": 9,

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ Path CompletionSupport.TestComponent.make
6868
"tags": [],
6969
"detail": "file module",
7070
"documentation": null
71+
}, {
72+
"label": "TypeAtPosCompletion",
73+
"kind": 9,
74+
"tags": [],
75+
"detail": "file module",
76+
"documentation": null
7177
}, {
7278
"label": "TypeDefinition",
7379
"kind": 9,

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

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ Path Js.Array2.m
5050
}]
5151

5252
Complete src/RecordCompletion.res 19:7
53-
posCursor:[19:7] posNoWhite:[19:6] Found expr:[19:3->25:4]
54-
Pexp_field [19:3->19:4] R.:[19:5->25:4]
53+
posCursor:[19:7] posNoWhite:[19:6] Found expr:[19:3->19:7]
54+
Pexp_field [19:3->19:4] R.:[19:5->19:7]
5555
Completable: Cpath Module[R].""
5656
Package opens Pervasives.JsxModules.place holder
5757
Resolved opens 1 pervasives
@@ -81,46 +81,3 @@ Path R.
8181
"documentation": null
8282
}]
8383

84-
Complete src/RecordCompletion.res 32:17
85-
posCursor:[32:17] posNoWhite:[32:15] Found expr:[31:16->34:1]
86-
Completable: Cexpression CTypeAtPos()->recordBody
87-
Package opens Pervasives.JsxModules.place holder
88-
Resolved opens 1 pervasives
89-
ContextPath CTypeAtPos()
90-
[{
91-
"label": "age",
92-
"kind": 5,
93-
"tags": [],
94-
"detail": "age?: int\n\noptRecord",
95-
"documentation": null
96-
}, {
97-
"label": "online",
98-
"kind": 5,
99-
"tags": [],
100-
"detail": "online?: bool\n\noptRecord",
101-
"documentation": null
102-
}]
103-
104-
Complete src/RecordCompletion.res 41:18
105-
posCursor:[41:18] posNoWhite:[41:16] Found expr:[38:8->44:1]
106-
Pexp_construct One:[38:8->38:11] [38:11->44:1]
107-
posCursor:[41:18] posNoWhite:[41:16] Found expr:[38:11->44:1]
108-
posCursor:[41:18] posNoWhite:[41:16] Found expr:[40:2->43:3]
109-
Completable: Cexpression CTypeAtPos()->variantPayload::One($1), recordBody
110-
Package opens Pervasives.JsxModules.place holder
111-
Resolved opens 1 pervasives
112-
ContextPath CTypeAtPos()
113-
[{
114-
"label": "age",
115-
"kind": 5,
116-
"tags": [],
117-
"detail": "age?: int\n\noptRecord",
118-
"documentation": null
119-
}, {
120-
"label": "online",
121-
"kind": 5,
122-
"tags": [],
123-
"detail": "online?: bool\n\noptRecord",
124-
"documentation": null
125-
}]
126-
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Complete src/TypeAtPosCompletion.res 7:17
2+
posCursor:[7:17] posNoWhite:[7:15] Found expr:[6:16->9:1]
3+
Completable: Cexpression CTypeAtPos()->recordBody
4+
Package opens Pervasives.JsxModules.place holder
5+
Resolved opens 1 pervasives
6+
ContextPath CTypeAtPos()
7+
[{
8+
"label": "age",
9+
"kind": 5,
10+
"tags": [],
11+
"detail": "age?: int\n\noptRecord",
12+
"documentation": null
13+
}, {
14+
"label": "online",
15+
"kind": 5,
16+
"tags": [],
17+
"detail": "online?: bool\n\noptRecord",
18+
"documentation": null
19+
}]
20+
21+
Complete src/TypeAtPosCompletion.res 16:18
22+
posCursor:[16:18] posNoWhite:[16:16] Found expr:[13:8->19:1]
23+
Pexp_construct One:[13:8->13:11] [13:11->19:1]
24+
posCursor:[16:18] posNoWhite:[16:16] Found expr:[13:11->19:1]
25+
posCursor:[16:18] posNoWhite:[16:16] Found expr:[15:2->18:3]
26+
Completable: Cexpression CTypeAtPos()->variantPayload::One($1), recordBody
27+
Package opens Pervasives.JsxModules.place holder
28+
Resolved opens 1 pervasives
29+
ContextPath CTypeAtPos()
30+
[{
31+
"label": "age",
32+
"kind": 5,
33+
"tags": [],
34+
"detail": "age?: int\n\noptRecord",
35+
"documentation": null
36+
}, {
37+
"label": "online",
38+
"kind": 5,
39+
"tags": [],
40+
"detail": "online?: bool\n\noptRecord",
41+
"documentation": null
42+
}]
43+

0 commit comments

Comments
 (0)