Skip to content

Commit 7032857

Browse files
zthcristianoc
authored andcommitted
example of when pipe completion across files doesnt work
1 parent 24d0a37 commit 7032857

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

analysis/tests/src/CompletionPipeChain.res

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,22 @@ let notAliased: CompletionSupport.Test.t = {name: 123}
7373

7474
// notAliased->
7575
// ^com
76+
77+
let renderer = CompletionSupport2.makeRenderer(
78+
~prepare=() => "hello",
79+
~render=props => {
80+
ignore(props)
81+
82+
// Doesn't work when tried through this chain. Presumably because it now goes through multiple different files.
83+
// props.support.root->ren
84+
// ^com
85+
let root = props.support.root
86+
ignore(root)
87+
88+
// Works here though when it's lifted out. Probably because it only goes through one file...?
89+
// root->ren
90+
// ^com
91+
React.null
92+
},
93+
(),
94+
)

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

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,3 +368,41 @@ Path CompletionSupport.Test.
368368
"documentation": null
369369
}]
370370

371+
Complete src/CompletionPipeChain.res 82:30
372+
posCursor:[82:30] posNoWhite:[82:29] Found expr:[76:15->93:1]
373+
Pexp_apply ...[76:15->76:46] (~prepare77:3->77:10=...[77:11->77:24], ~render78:3->78:9=...[78:10->91:3], ...[92:2->92:4])
374+
posCursor:[82:30] posNoWhite:[82:29] Found expr:[78:10->91:3]
375+
posCursor:[82:30] posNoWhite:[82:29] Found expr:[79:4->90:14]
376+
posCursor:[82:30] posNoWhite:[82:29] Found expr:[82:7->90:14]
377+
posCursor:[82:30] posNoWhite:[82:29] Found expr:[82:7->82:30]
378+
Completable: Cpath Value[props].support.root->ren
379+
ContextPath Value[props].support.root->ren
380+
ContextPath Value[props].support.root
381+
ContextPath Value[props].support
382+
ContextPath Value[props]
383+
Path props
384+
Path CompletionSupport.ReactDOM.Client.Root.ren
385+
[]
386+
387+
Complete src/CompletionPipeChain.res 88:16
388+
posCursor:[88:16] posNoWhite:[88:15] Found expr:[76:15->93:1]
389+
Pexp_apply ...[76:15->76:46] (~prepare77:3->77:10=...[77:11->77:24], ~render78:3->78:9=...[78:10->91:3], ...[92:2->92:4])
390+
posCursor:[88:16] posNoWhite:[88:15] Found expr:[78:10->91:3]
391+
posCursor:[88:16] posNoWhite:[88:15] Found expr:[79:4->90:14]
392+
posCursor:[88:16] posNoWhite:[88:15] Found expr:[84:4->90:14]
393+
posCursor:[88:16] posNoWhite:[88:15] Found expr:[85:4->90:14]
394+
posCursor:[88:16] posNoWhite:[88:15] Found expr:[88:7->90:14]
395+
posCursor:[88:16] posNoWhite:[88:15] Found expr:[88:7->88:16]
396+
Completable: Cpath Value[root]->ren
397+
ContextPath Value[root]->ren
398+
ContextPath Value[root]
399+
Path root
400+
Path ReactDOM.Client.Root.ren
401+
[{
402+
"label": "ReactDOM.Client.Root.render",
403+
"kind": 12,
404+
"tags": [],
405+
"detail": "(t, React.element) => unit",
406+
"documentation": null
407+
}]
408+

0 commit comments

Comments
 (0)