Skip to content

Commit a328945

Browse files
committed
Fix reference to interfaces
1 parent 6ddf611 commit a328945

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

analysis/src/References.ml

+9-5
Original file line numberDiff line numberDiff line change
@@ -474,15 +474,19 @@ let allReferencesForLocItem ~full:({file; package} as full) locItem =
474474
(Uri2.fromPath loc.Location.loc_start.pos_fname, [loc])))
475475
|> List.flatten
476476
in
477-
let targetModuleReference =
477+
let targetModuleReferences =
478478
match Hashtbl.find_opt package.pathsForModule moduleName with
479479
| None -> []
480480
| Some paths -> (
481-
match SharedTypes.getSrc paths with
482-
| None -> []
483-
| Some src -> [(Uri2.fromPath src, [Utils.topLoc src])])
481+
let moduleSrcToRef src = (Uri2.fromPath src, [Utils.topLoc src]) in
482+
match paths with
483+
| Impl (_, None) -> []
484+
| Impl (_, Some src) -> [moduleSrcToRef src]
485+
| Intf (_, srci) -> [moduleSrcToRef srci]
486+
| IntfAndImpl (_, srci, _, src) ->
487+
[moduleSrcToRef srci; moduleSrcToRef src])
484488
in
485-
List.append targetModuleReference otherModulesReferences
489+
List.append targetModuleReferences otherModulesReferences
486490
| Typed (_, _, NotFound) | LModule NotFound | Constant _ -> []
487491
| TypeDefinition (_, _, stamp) -> forLocalStamp ~full stamp Type
488492
| Typed (_, _, (LocalReference (stamp, tip) | Definition (stamp, tip)))

0 commit comments

Comments
 (0)