Skip to content
This repository was archived by the owner on Apr 24, 2021. It is now read-only.

Commit e60f479

Browse files
committed
Avoid returning docstring that will be overridden.
1 parent d2143a5 commit e60f479

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

examples/example-project/src/ZZ.res

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,8 @@ let testRecordFields = (gr: gr) => {
7777
let str = gr.s
7878
str
7979
}
80+
81+
@ocaml.doc("vr docstring")
82+
type vr = | V1 | V2
83+
84+
let v1 = V1

src/rescript-editor-support/References.re

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,11 @@ let definedForLoc = (~file, ~getModule, locKind) => {
8686
let inner = (~file, stamp, tip) => {
8787
switch (tip) {
8888
| Constructor(name) =>
89-
let%opt declared =
90-
Query.declaredForTip(~stamps=file.stamps, stamp, tip);
9189
let%opt constructor = Query.getConstructor(file, stamp, name);
92-
Some((declared.docstring, file, `Constructor(constructor)));
90+
Some((None, file, `Constructor(constructor)));
9391
| Attribute(name) =>
94-
let%opt declared =
95-
Query.declaredForTip(~stamps=file.stamps, stamp, tip);
9692
let%opt attribute = Query.getAttribute(file, stamp, name);
97-
Some((declared.docstring, file, `Attribute(attribute)));
93+
Some((None, file, `Attribute(attribute)));
9894
| _ =>
9995
maybeLog(
10096
"Trying for declared "
@@ -104,8 +100,8 @@ let definedForLoc = (~file, ~getModule, locKind) => {
104100
++ " in file "
105101
++ file.uri,
106102
);
107-
let%opt x = Query.declaredForTip(~stamps=file.stamps, stamp, tip);
108-
Some((x.docstring, file, `Declared));
103+
let%opt declared = Query.declaredForTip(~stamps=file.stamps, stamp, tip);
104+
Some((declared.docstring, file, `Declared));
109105
};
110106
};
111107

0 commit comments

Comments
 (0)