@@ -468,15 +468,30 @@ let forLocalStamp ~full:{file; extra; package} stamp tip =
468
468
let allReferencesForLocItem ~full :({file; package} as full ) locItem =
469
469
match locItem.locType with
470
470
| TopLevelModule moduleName ->
471
- let locs =
472
- match Hashtbl. find_opt full.extra.fileReferences moduleName with
471
+ let otherModulesReferences =
472
+ package.localModules
473
+ |> Utils. filterMap (fun name ->
474
+ match ProcessCmt. fileForModule ~package name with
475
+ | None -> None
476
+ | Some file -> ProcessCmt. getFullFromCmt ~uri: file.uri)
477
+ |> List. map (fun full ->
478
+ match Hashtbl. find_opt full.extra.fileReferences moduleName with
479
+ | None -> []
480
+ | Some locs ->
481
+ locs
482
+ |> List. map (fun loc ->
483
+ (Uri2. fromPath loc.Location. loc_start.pos_fname, [loc])))
484
+ |> List. flatten
485
+ in
486
+ let targetModuleReference =
487
+ match Hashtbl. find_opt package.pathsForModule moduleName with
473
488
| None -> []
474
- | Some locs ->
475
- locs
476
- |> List. map ( fun loc ->
477
- (Uri2. fromPath loc. Location. loc_start.pos_fname , [loc]) )
489
+ | Some paths -> (
490
+ match SharedTypes. getSrc paths with
491
+ | None -> []
492
+ | Some src -> [ (Uri2. fromPath src , [Utils. topLoc src])] )
478
493
in
479
- locs
494
+ List. append targetModuleReference otherModulesReferences
480
495
| Typed (_ , _ , NotFound ) | LModule NotFound | Constant _ -> []
481
496
| TypeDefinition (_ , _ , stamp ) -> forLocalStamp ~full stamp Type
482
497
| Typed (_, _, (LocalReference (stamp, tip) | Definition (stamp, tip)))
0 commit comments