-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathHover.res
More file actions
132 lines (99 loc) · 1.97 KB
/
Hover.res
File metadata and controls
132 lines (99 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
let abc = 22 + 34
// ^hov
type t = (int, float)
// ^hov
module Id = {
// ^hov
type x = int
}
@ocaml.doc("This module is commented")
module Dep: {
@ocaml.doc("Some doc comment")
let customDouble: int => int
} = {
let customDouble = foo => foo * 2
}
module D = Dep
// ^hov
let cd = D.customDouble
// ^hov
module HoverInsideModuleWithComponent = {
let x = 2 // check that hover on x works
// ^hov
@react.component
let make = () => React.null
}
@ocaml.doc("Doc comment for functionWithTypeAnnotation")
let functionWithTypeAnnotation: unit => int = () => 1
// ^hov
@react.component
let make = (~name) => React.string(name)
// ^hov
@react.component
let make2 = (~name: string) => React.string(name)
// ^hov
let num = 34
// ^hov
module type Logger = {
// ^hov
let log: string => unit
}
module JsLogger: Logger = {
// ^hov
let log = (msg: string) => Js.log(msg)
let _oneMore = 3
}
module JJ = JsLogger
// ^def
module IdDefinedTwice = {
// ^hov
let _x = 10
let y = 20
let _x = 10
}
module A = {
let x = 13
}
module B = A
// ^hov
module C = B
// ^hov
module Comp = {
@react.component
let make = (~children: React.element) => children
}
module Comp1 = Comp
let _ = <Comp> <div /> <div /> </Comp>
// ^hov
let _ = <Comp1> <div /> <div /> </Comp1>
// ^hov
type r<'a> = {i: 'a, f: float}
let _get = r => r.f +. r.i
// ^hov
let withAs = (~xx as yyy) => yyy + 1
// ^hov
module AA = {
type cond<'a> = [< #str(string)] as 'a
let fnnxx = (b: cond<_>) => true ? b : b
}
let funAlias = AA.fnnxx
let typeOk = funAlias
// ^hov
let typeDuplicate = AA.fnnxx
// ^hov
@live let dd = 34
// ^hov
let arity0a = (. ()) => {
//^hov
let f = () => 3
f
}
let arity0b = (. (), . ()) => 3
// ^hov
let arity0c = (. (), ()) => 3
// ^hov
let arity0d = (. ()) => {
// ^hov
let f = () => 3
f
}