@@ -133,45 +133,45 @@ let newHover = (~file: SharedTypes.file, ~getModule, loc) => {
133133 | None => (typeString, docstring)
134134 | Some ((extra , extraDocstring )) => (
135135 typeString ++ "\n\n " ++ codeBlock(extra),
136- extraDocstring,
136+ switch (extraDocstring) {
137+ | None => []
138+ | Some (d ) => [ d]
139+ },
137140 )
138141 };
139- (Some ( typeString) , docstring);
142+ (typeString, docstring);
140143 };
141144
142145 let parts =
143146 switch (References . definedForLoc(~file, ~getModule, locKind)) {
144147 | None =>
145- let (typeString , docstring ) = t |> fromType(~docstring= None );
146- [ typeString, docstring] ;
148+ let (typeString , docstring ) = t |> fromType(~docstring= [] );
149+ [ typeString, ... docstring] ;
147150 | Some ((docstring , res )) =>
148- let parts =
149- switch (res) {
150- | ` Declared =>
151- let (typeString , docstring ) = t |> fromType(~docstring);
152- [ typeString, docstring] ;
153- | ` Constructor ({cname: {txt}, args}) =>
154- let (typeString , docstring ) = t |> fromType(~docstring);
151+ switch (res) {
152+ | ` Declared =>
153+ let (typeString , docstring ) = t |> fromType(~docstring);
154+ [ typeString, ... docstring] ;
155+ | ` Constructor ({cname: {txt}, args}) =>
156+ let (typeString , docstring ) = t |> fromType(~docstring);
155157
156- let argsString =
157- switch (args) {
158- | [] => ""
159- | _ =>
160- args
161- |> List . map(((t, _)) => Shared . typeToString(t))
162- |> String . concat(", " )
163- |> Printf . sprintf("(% s )" )
164- };
158+ let argsString =
159+ switch (args) {
160+ | [] => ""
161+ | _ =>
162+ args
163+ |> List . map(((t, _)) => Shared . typeToString(t))
164+ |> String . concat(", " )
165+ |> Printf . sprintf("(% s )" )
166+ };
165167
166- [ typeString, Some (codeBlock(txt ++ argsString)), docstring] ;
167- | ` Field ({typ}) =>
168- let (typeString , docstring ) = typ |> fromType(~docstring);
169- [ typeString, docstring] ;
170- };
171-
172- parts;
168+ [ typeString, codeBlock(txt ++ argsString), ... docstring] ;
169+ | ` Field ({typ}) =>
170+ let (typeString , docstring ) = typ |> fromType(~docstring);
171+ [ typeString, ... docstring] ;
172+ }
173173 };
174174
175- Some (String . concat("\n\n " , parts |> Utils . filterMap(x => x) ));
175+ Some (String . concat("\n\n " , parts));
176176 };
177177};
0 commit comments