File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,17 @@ let rec implementation items =
1414 | false -> Some str_loc.loc_start.pos_fname)
1515 | [] -> None
1616
17+ let transform_to_absolute_path (path : string option ) =
18+ let transform path =
19+ if Filename. is_relative path then Filename. concat (Sys. getcwd () ) path
20+ else path
21+ in
22+ Option. map transform path
23+
1724let cmt cmt_annots =
1825 match cmt_annots with
19- | Cmt_format. Interface signature -> interface signature.sig_items
20- | Implementation structure -> implementation structure.str_items
26+ | Cmt_format. Interface signature ->
27+ transform_to_absolute_path (interface signature.sig_items)
28+ | Implementation structure ->
29+ transform_to_absolute_path (implementation structure.str_items)
2130 | _ -> None
Original file line number Diff line number Diff line change 1+ val cmt : Cmt_format .binary_annots -> string option
2+ (* *
3+ [cmt annots] given [Cmt_format.binary_annots] it returns an absolute source file path
4+ if the file exists, otherwise it returns None.
5+
6+ @param annots The binary annotations to be processed.
7+ @return An optional absolute path to the source file.
8+ *)
You can’t perform that action at this time.
0 commit comments