File tree 3 files changed +11
-25
lines changed
3 files changed +11
-25
lines changed Original file line number Diff line number Diff line change @@ -1256,9 +1256,8 @@ let getFullFromCmt ~uri =
1256
1256
let extraForModule ~package modname =
1257
1257
if Hashtbl. mem package.pathsForModule modname then
1258
1258
let paths = Hashtbl. find package.pathsForModule modname in
1259
- match SharedTypes. getSrc paths with
1260
- | None -> None
1261
- | Some src -> getFullFromCmt ~uri: (Uri2. fromPath src)
1259
+ let uri = SharedTypes. getUri paths in
1260
+ getFullFromCmt ~uri
1262
1261
else None
1263
1262
1264
1263
let fileForCmt ~moduleName ~cmt ~uri state =
@@ -1287,11 +1286,7 @@ let fileForModule modname ~package =
1287
1286
let paths = Hashtbl. find package.pathsForModule modname in
1288
1287
(* TODO: do better *)
1289
1288
let cmt = SharedTypes. getCmt ~interface: false paths in
1290
- let uri =
1291
- match SharedTypes. getSrc paths with
1292
- | Some sourcePath -> Uri2. fromPath sourcePath
1293
- | None -> Uri2. fromPath cmt
1294
- in
1289
+ let uri = SharedTypes. getUri paths in
1295
1290
Log. log (" FINDING docs for module " ^ SharedTypes. showPaths paths);
1296
1291
Log. log (" FINDING " ^ cmt ^ " uri " ^ Uri2. toString uri);
1297
1292
match fileForCmt ~module Name:modname ~cmt ~uri state with
Original file line number Diff line number Diff line change @@ -305,13 +305,6 @@ let definition ~file ~package stamp tip =
305
305
maybeLog (" Inner uri " ^ Uri2. toString uri);
306
306
Some (uri, loc))
307
307
308
- let orLog message v =
309
- match v with
310
- | None ->
311
- maybeLog message;
312
- None
313
- | _ -> v
314
-
315
308
let definitionForLocItem ~full :{file; package} locItem =
316
309
match locItem.locType with
317
310
| Typed (_ , _ , Definition (stamp , tip )) -> (
@@ -335,13 +328,11 @@ let definitionForLocItem ~full:{file; package} locItem =
335
328
None
336
329
| TopLevelModule name -> (
337
330
maybeLog (" Toplevel " ^ name);
338
- let open Infix in
339
- match
340
- Hashtbl. find_opt package.pathsForModule name
341
- |> orLog " No paths found" |?> getSrc |> orLog " No src found"
342
- with
331
+ match Hashtbl. find_opt package.pathsForModule name with
343
332
| None -> None
344
- | Some src -> Some (Uri2. fromPath src, Utils. topLoc src))
333
+ | Some paths ->
334
+ let uri = getUri paths in
335
+ Some (uri, Utils. topLoc (Uri2. toPath uri)))
345
336
| LModule (LocalReference (stamp, tip))
346
337
| Typed (_ , _ , LocalReference (stamp , tip )) ->
347
338
maybeLog (" Local defn " ^ tipToString tip);
Original file line number Diff line number Diff line change @@ -130,11 +130,11 @@ let showPaths paths =
130
130
| IntfAndImpl {cmti; resi; cmt; res} ->
131
131
Printf. sprintf " IntfAndImpl(%s, %s, %s, %s)" cmti resi cmt res
132
132
133
- let getSrc p =
133
+ let getUri p =
134
134
match p with
135
- | Impl {res} -> Some res
136
- | Namespace _ -> None
137
- | IntfAndImpl {resi} -> Some resi
135
+ | Impl {res} -> Uri2. fromPath res
136
+ | Namespace {cmt} -> Uri2. fromPath cmt
137
+ | IntfAndImpl {resi} -> Uri2. fromPath resi
138
138
139
139
let getCmt ~interface p =
140
140
match p with
You can’t perform that action at this time.
0 commit comments