Skip to content

Commit

Permalink
Add example of hover on record that would require type substitution.
Browse files Browse the repository at this point in the history
See #349
  • Loading branch information
cristianoc committed Aug 31, 2022
1 parent ddfc0b8 commit 171fdf5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions analysis/tests/src/Hover.res
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,14 @@ module ModWithDocComment = {

/*** module level doc comment 2 */
}

module TypeSustitutionRecords = {
type foo<'a> = {content: 'a, zzz: string}
type bar = {age: int}
type foobar = foo<bar>

let x1: foo<bar> = {content: {age: 42}, zzz: ""}
// ^hov
let x2: foobar = {content: {age: 42}, zzz: ""}
// ^hov
}
6 changes: 6 additions & 0 deletions analysis/tests/src/expected/Hover.res.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,9 @@ Hover src/Hover.res 142:9
Hover src/Hover.res 146:6
{"contents": "```rescript\nint\n```\n\n doc comment 2 "}

Hover src/Hover.res 163:23
{"contents": "```rescript\nfoo<'a>\n```\n\n```rescript\ntype foo<'a> = {content: 'a, zzz: string}\n```"}

Hover src/Hover.res 165:22
{"contents": "```rescript\nfoo<'a>\n```\n\n```rescript\ntype foo<'a> = {content: 'a, zzz: string}\n```"}

0 comments on commit 171fdf5

Please sign in to comment.