Skip to content

Commit 171fdf5

Browse files
committed
Add example of hover on record that would require type substitution.
See #349
1 parent ddfc0b8 commit 171fdf5

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

analysis/tests/src/Hover.res

+11
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,14 @@ module ModWithDocComment = {
155155

156156
/*** module level doc comment 2 */
157157
}
158+
159+
module TypeSustitutionRecords = {
160+
type foo<'a> = {content: 'a, zzz: string}
161+
type bar = {age: int}
162+
type foobar = foo<bar>
163+
164+
let x1: foo<bar> = {content: {age: 42}, zzz: ""}
165+
// ^hov
166+
let x2: foobar = {content: {age: 42}, zzz: ""}
167+
// ^hov
168+
}

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

+6
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,9 @@ Hover src/Hover.res 142:9
104104
Hover src/Hover.res 146:6
105105
{"contents": "```rescript\nint\n```\n\n doc comment 2 "}
106106

107+
Hover src/Hover.res 163:23
108+
{"contents": "```rescript\nfoo<'a>\n```\n\n```rescript\ntype foo<'a> = {content: 'a, zzz: string}\n```"}
109+
110+
Hover src/Hover.res 165:22
111+
{"contents": "```rescript\nfoo<'a>\n```\n\n```rescript\ntype foo<'a> = {content: 'a, zzz: string}\n```"}
112+

0 commit comments

Comments
 (0)