Skip to content

Commit 11b8276

Browse files
committed
Refactor: no need to pass around getExtra.
1 parent fe5da92 commit 11b8276

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

analysis/src/Commands.ml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,7 @@ let references ~file ~line ~col ~extra ~package =
143143
| None -> Protocol.null
144144
| Some (_, loc) ->
145145
let allReferences =
146-
References.allReferencesForLoc ~package ~file ~extra
147-
~getExtra:(ProcessCmt.extraForModule ~package)
148-
loc
146+
References.allReferencesForLoc ~package ~file ~extra loc
149147
in
150148
let allLocs =
151149
allReferences

analysis/src/References.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ let rec pathFromVisibility visibilityPath current =
369369
let pathFromVisibility visibilityPath tipName =
370370
pathFromVisibility visibilityPath (Tip tipName)
371371

372-
let forLocalStamp ~package ~file ~extra ~getExtra stamp tip =
372+
let forLocalStamp ~package ~file ~extra stamp tip =
373373
let env = ProcessCmt.fileEnv file in
374374
let open Infix in
375375
match
@@ -422,7 +422,7 @@ let forLocalStamp ~package ~file ~extra ~getExtra stamp tip =
422422
match ProcessCmt.fileForModule ~package name with
423423
| None -> None
424424
| Some file -> (
425-
match getExtra name with
425+
match ProcessCmt.extraForModule ~package name with
426426
| None -> None
427427
| Some extra -> (
428428
match
@@ -447,21 +447,21 @@ let forLocalStamp ~package ~file ~extra ~getExtra stamp tip =
447447
in
448448
(file.uri, local) :: externals)
449449

450-
let allReferencesForLoc ~package ~file ~extra ~getExtra loc =
450+
let allReferencesForLoc ~package ~file ~extra loc =
451451
match loc with
452452
| Explanation _
453453
| Typed (_, NotFound)
454454
| LModule NotFound
455455
| TopLevelModule _ | Constant _ ->
456456
[]
457457
| TypeDefinition (_, _, stamp) ->
458-
forLocalStamp ~package ~file ~extra ~getExtra stamp Type
458+
forLocalStamp ~package ~file ~extra stamp Type
459459
| Typed (_, (LocalReference (stamp, tip) | Definition (stamp, tip)))
460460
| LModule (LocalReference (stamp, tip) | Definition (stamp, tip)) ->
461461
maybeLog
462462
("Finding references for " ^ Uri2.toString file.uri ^ " and stamp "
463463
^ string_of_int stamp ^ " and tip " ^ tipToString tip);
464-
forLocalStamp ~package ~file ~extra ~getExtra stamp tip
464+
forLocalStamp ~package ~file ~extra stamp tip
465465
| LModule (GlobalReference (moduleName, path, tip))
466466
| Typed (_, GlobalReference (moduleName, path, tip)) -> (
467467
match ProcessCmt.fileForModule ~package moduleName with
@@ -481,4 +481,4 @@ let allReferencesForLoc ~package ~file ~extra ~getExtra loc =
481481
("Finding references for (global) " ^ Uri2.toString env.file.uri
482482
^ " and stamp " ^ string_of_int stamp ^ " and tip "
483483
^ tipToString tip);
484-
forLocalStamp ~package ~file ~extra ~getExtra stamp tip))))
484+
forLocalStamp ~package ~file ~extra stamp tip))))

0 commit comments

Comments
 (0)