Skip to content

Commit 7518db6

Browse files
committed
Add example showing how shadowing affects hovering on doc comments.
See #621
1 parent 92d5930 commit 7518db6

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

analysis/tests/src/Hover.res

+23
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,26 @@ let usr: useR = {
210210

211211
// let f = usr
212212
// ^hov
213+
214+
215+
module NotShadowed = {
216+
/** Stuff */
217+
let xx_ = 10
218+
219+
/** More Stuff */
220+
let xx = xx_
221+
}
222+
223+
module Shadowed = {
224+
/** Stuff */
225+
let xx = 10
226+
227+
/** More Stuff */
228+
let xx = xx
229+
}
230+
231+
let _ = NotShadowed.xx
232+
// ^hov
233+
234+
let _ = Shadowed.xx
235+
// ^hov

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

+6
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,9 @@ Pexp_ident usr:[210:11->210:14]
171171
Completable: Cpath Value[usr]
172172
{"contents": "```rescript\nuseR\n```\n\n\n```\n \n```\n```rescript\ntype useR = {x: int, y: list<option<r<float>>>}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C200%2C0%5D)\n\n---\n\n\n\n```\n \n```\n```rescript\ntype r<'a> = {i: 'a, f: float}\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C101%2C0%5D)\n\n---\n"}
173173

174+
Hover src/Hover.res 230:20
175+
{"contents": "```rescript\nint\n```\n\n More Stuff "}
176+
177+
Hover src/Hover.res 233:17
178+
{"contents": "```rescript\nint\n```"}
179+

0 commit comments

Comments
 (0)