Skip to content

Commit fcd18ee

Browse files
committed
vendor rescript-react for testing
1 parent a098fe1 commit fcd18ee

29 files changed

+1493
-27
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
"nyc": "15.0.0"
8080
},
8181
"workspaces": [
82+
"tests/dependencies/**",
8283
"tests/analysis_tests/**",
8384
"tests/gentype_tests/**",
8485
"tests/tools_tests"

tests/analysis_tests/tests-reanalyze/deadcode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"clean": "rescript clean -with-deps"
77
},
88
"dependencies": {
9-
"@rescript/react": "^0.13.1",
9+
"@rescript/react": "workspace:tests/dependencies/rescript-react",
1010
"rescript": "workspace:^"
1111
}
1212
}

tests/analysis_tests/tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"clean": "rescript clean -with-deps"
77
},
88
"dependencies": {
9-
"@rescript/react": "^0.13.1",
9+
"@rescript/react": "workspace:tests/dependencies/rescript-react",
1010
"rescript": "workspace:^"
1111
}
1212
}

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1912,6 +1912,16 @@ Path Res
19121912
"tags": [],
19131913
"detail": "module Result",
19141914
"documentation": null
1915+
}, {
1916+
"label": "RescriptReactErrorBoundary",
1917+
"kind": 9,
1918+
"tags": [],
1919+
"detail": "module RescriptReactErrorBoundary",
1920+
"documentation": null,
1921+
"data": {
1922+
"modulePath": "RescriptReactErrorBoundary",
1923+
"filePath": "src/Completion.res"
1924+
}
19151925
}, {
19161926
"label": "RescriptTools",
19171927
"kind": 9,

tests/analysis_tests/tests/src/expected/CompletionExpressions.res.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,13 +865,13 @@ ContextPath CArgument Value[fnTakingCallback]($2)
865865
ContextPath Value[fnTakingCallback]
866866
Path fnTakingCallback
867867
[{
868-
"label": "mouse => mouse",
868+
"label": "event => event",
869869
"kind": 12,
870870
"tags": [],
871871
"detail": "ReactEvent.Mouse.t => unit",
872872
"documentation": null,
873873
"sortText": "A",
874-
"insertText": "${1:mouse} => ${0:mouse}",
874+
"insertText": "${1:event} => ${0:event}",
875875
"insertTextFormat": 2
876876
}]
877877

tests/analysis_tests/tests/src/expected/CompletionInferValues.res.txt

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,15 @@ ContextPath CArgument CArgument Value[reactEventFn]($0)($0)
245245
ContextPath CArgument Value[reactEventFn]($0)
246246
ContextPath Value[reactEventFn]
247247
Path reactEventFn
248-
[]
248+
CPPipe pathFromEnv:ReactEvent.Mouse found:false
249+
Path ReactEvent.Mouse.pr
250+
[{
251+
"label": "ReactEvent.Mouse.preventDefault",
252+
"kind": 12,
253+
"tags": [],
254+
"detail": "t => unit",
255+
"documentation": null
256+
}]
249257

250258
Complete src/CompletionInferValues.res 41:50
251259
posCursor:[41:50] posNoWhite:[41:49] Found expr:[41:12->41:56]
@@ -261,7 +269,16 @@ Path event
261269
ContextPath CArgument CJsxPropValue [div] onMouseEnter($0)
262270
ContextPath CJsxPropValue [div] onMouseEnter
263271
Path ReactDOM.domProps
264-
[]
272+
Path JsxDOM.domProps
273+
CPPipe pathFromEnv:JsxEvent.Mouse found:false
274+
Path JsxEvent.Mouse.pr
275+
[{
276+
"label": "JsxEvent.Mouse.preventDefault",
277+
"kind": 12,
278+
"tags": [],
279+
"detail": "t => unit",
280+
"documentation": null
281+
}]
265282

266283
Complete src/CompletionInferValues.res 44:50
267284
posCursor:[44:50] posNoWhite:[44:49] Found expr:[44:12->44:56]
@@ -793,7 +810,21 @@ ContextPath CArgument CArgument Value[fn2](~cb)($0)
793810
ContextPath CArgument Value[fn2](~cb)
794811
ContextPath Value[fn2]
795812
Path fn2
796-
[]
813+
CPPipe pathFromEnv:ReactDOM.Client.Root found:false
814+
Path ReactDOM.Client.Root.
815+
[{
816+
"label": "ReactDOM.Client.Root.unmount",
817+
"kind": 12,
818+
"tags": [],
819+
"detail": "(t, unit) => unit",
820+
"documentation": null
821+
}, {
822+
"label": "ReactDOM.Client.Root.render",
823+
"kind": 12,
824+
"tags": [],
825+
"detail": "(t, React.element) => unit",
826+
"documentation": null
827+
}]
797828

798829
Complete src/CompletionInferValues.res 139:30
799830
posCursor:[139:30] posNoWhite:[139:29] Found expr:[139:3->139:33]
@@ -918,7 +949,21 @@ ContextPath CArgument CArgument Value[CompletionSupport2, makeRenderer](~render)
918949
ContextPath CArgument Value[CompletionSupport2, makeRenderer](~render)
919950
ContextPath Value[CompletionSupport2, makeRenderer]
920951
Path CompletionSupport2.makeRenderer
921-
[]
952+
CPPipe pathFromEnv:ReactDOM.Client.Root found:false
953+
Path ReactDOM.Client.Root.
954+
[{
955+
"label": "ReactDOM.Client.Root.unmount",
956+
"kind": 12,
957+
"tags": [],
958+
"detail": "(t, unit) => unit",
959+
"documentation": null
960+
}, {
961+
"label": "ReactDOM.Client.Root.render",
962+
"kind": 12,
963+
"tags": [],
964+
"detail": "(t, React.element) => unit",
965+
"documentation": null
966+
}]
922967

923968
Hover src/CompletionInferValues.res 160:27
924969
Nothing at that position. Now trying to use completion.

tests/analysis_tests/tests/src/expected/CompletionJsx.res.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,8 +578,14 @@ Completable: Cjsx([h1], hidd, [hidd])
578578
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
579579
Resolved opens 1 Stdlib
580580
Path ReactDOM.domProps
581-
[completing-lowercase-jsx] could not find element props to complete from.
582-
[]
581+
Path JsxDOM.domProps
582+
[{
583+
"label": "hidden",
584+
"kind": 4,
585+
"tags": [],
586+
"detail": "bool",
587+
"documentation": null
588+
}]
583589

584590
Complete src/CompletionJsx.res 61:30
585591
posCursor:[61:30] posNoWhite:[61:28] Found expr:[61:4->61:29]

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

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,20 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder
223223
Resolved opens 1 Stdlib
224224
ContextPath CJsxPropValue [div] muted
225225
Path ReactDOM.domProps
226-
[]
226+
Path JsxDOM.domProps
227+
[{
228+
"label": "true",
229+
"kind": 4,
230+
"tags": [],
231+
"detail": "bool",
232+
"documentation": null
233+
}, {
234+
"label": "false",
235+
"kind": 4,
236+
"tags": [],
237+
"detail": "bool",
238+
"documentation": null
239+
}]
227240

228241
Complete src/CompletionJsxProps.res 18:29
229242
posCursor:[18:29] posNoWhite:[18:28] Found expr:[18:12->18:32]
@@ -233,7 +246,17 @@ Package opens Stdlib.place holder Pervasives.JsxModules.place holder
233246
Resolved opens 1 Stdlib
234247
ContextPath CJsxPropValue [div] onMouseEnter
235248
Path ReactDOM.domProps
236-
[]
249+
Path JsxDOM.domProps
250+
[{
251+
"label": "event => event",
252+
"kind": 12,
253+
"tags": [],
254+
"detail": "JsxEvent.Mouse.t => unit",
255+
"documentation": null,
256+
"sortText": "A",
257+
"insertText": "{${1:event} => ${0:event}}",
258+
"insertTextFormat": 2
259+
}]
237260

238261
Complete src/CompletionJsxProps.res 22:52
239262
posCursor:[22:52] posNoWhite:[22:51] Found expr:[22:12->22:52]

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

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,15 @@ CPPipe pathFromEnv:CompletionSupport2.Internal found:false
423423
Path CompletionSupport2.Internal.support
424424
CPPipe pathFromEnv:CompletionSupport.Nested found:false
425425
Path CompletionSupport.Nested.root
426-
[]
426+
CPPipe pathFromEnv:ReactDOM.Client.Root found:false
427+
Path ReactDOM.Client.Root.ren
428+
[{
429+
"label": "ReactDOM.Client.Root.render",
430+
"kind": 12,
431+
"tags": [],
432+
"detail": "(t, React.element) => unit",
433+
"documentation": null
434+
}]
427435

428436
Complete src/CompletionPipeChain.res 88:16
429437
posCursor:[88:16] posNoWhite:[88:15] Found expr:[76:15->93:1]
@@ -440,7 +448,15 @@ Resolved opens 1 Stdlib
440448
ContextPath Value[root]->ren
441449
ContextPath Value[root]
442450
Path root
443-
[]
451+
CPPipe pathFromEnv:ReactDOM.Client.Root found:false
452+
Path ReactDOM.Client.Root.ren
453+
[{
454+
"label": "ReactDOM.Client.Root.render",
455+
"kind": 12,
456+
"tags": [],
457+
"detail": "(t, React.element) => unit",
458+
"documentation": null
459+
}]
444460

445461
Complete src/CompletionPipeChain.res 95:20
446462
posCursor:[95:20] posNoWhite:[95:19] Found expr:[95:3->95:21]

tests/analysis_tests/tests/src/expected/Div.res.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ Completable: Cjsx([div], dangerous, [dangerous])
88
Package opens Stdlib.place holder Pervasives.JsxModules.place holder
99
Resolved opens 1 Stdlib
1010
Path ReactDOM.domProps
11-
[completing-lowercase-jsx] could not find element props to complete from.
12-
[]
11+
Path JsxDOM.domProps
12+
[{
13+
"label": "dangerouslySetInnerHTML",
14+
"kind": 4,
15+
"tags": [],
16+
"detail": "{\"__html\": string}",
17+
"documentation": null
18+
}]
1319

0 commit comments

Comments
 (0)