Skip to content

Commit 70b7db6

Browse files
nojafzth
authored andcommitted
Add example case (#1058)
1 parent 58cf089 commit 70b7db6

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

analysis/tests/src/DotCompletionEverywhere.res

+19
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,22 @@ let arr = [1, 2, 3]
6666

6767
// arr.m
6868
// ^com
69+
70+
module DOMAPI = {
71+
type htmlElement = {prefix: string }
72+
73+
@editor.completeFrom(HTMLButtonElement)
74+
type rec htmlButtonElement = {mutable disabled: bool}
75+
}
76+
77+
module HTMLButtonElement = {
78+
open DOMAPI
79+
80+
@send
81+
external checkValidity: htmlButtonElement => bool = "checkValidity"
82+
}
83+
84+
let button: DOMAPI.htmlButtonElement = %todo
85+
86+
// button.
87+
// ^com

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

+20
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,23 @@ Path Js.Array2.m
252252
}
253253
}]
254254

255+
Complete src/DotCompletionEverywhere.res 85:10
256+
posCursor:[85:10] posNoWhite:[85:9] Found expr:[85:3->85:10]
257+
Pexp_field [85:3->85:9] _:[88:0->85:10]
258+
Completable: Cpath Value[button].""
259+
Package opens Pervasives.JsxModules.place holder
260+
Resolved opens 1 pervasives
261+
ContextPath Value[button].""
262+
ContextPath Value[button]
263+
Path button
264+
CPPipe pathFromEnv:DOMAPI found:true
265+
Path DOMAPI.
266+
Path HTMLButtonElement.
267+
[{
268+
"label": "disabled",
269+
"kind": 5,
270+
"tags": [],
271+
"detail": "bool",
272+
"documentation": {"kind": "markdown", "value": "```rescript\ndisabled: bool\n```\n\n```rescript\ntype htmlButtonElement = {mutable disabled: bool}\n```"}
273+
}]
274+

0 commit comments

Comments
 (0)