File tree Expand file tree Collapse file tree 1 file changed +11
-26
lines changed Expand file tree Collapse file tree 1 file changed +11
-26
lines changed Original file line number Diff line number Diff line change @@ -641,42 +641,27 @@ let extractEmbedded ~extensionPoints ~filename =
641
641
])
642
642
|> List. rev |> array
643
643
644
+ (* * Dump the contents of a typed tree file *)
644
645
let dump entryPointFile =
645
646
let path =
646
- match Filename. is_relative entryPointFile with
647
- | true -> Unix. realpath entryPointFile
648
- | false -> entryPointFile
647
+ if Filename. is_relative entryPointFile then Unix. realpath entryPointFile
648
+ else entryPointFile
649
649
in
650
650
let result =
651
- match
651
+ if
652
652
FindFiles. isImplementation path = false
653
653
&& FindFiles. isInterface path = false
654
- with
655
- | false -> (
656
- let path =
657
- if FindFiles. isImplementation path then
658
- let pathAsResi =
659
- (path |> Filename. dirname) ^ " /"
660
- ^ (path |> Filename. basename |> Filename. chop_extension)
661
- ^ " .resi"
662
- in
663
- if Sys. file_exists pathAsResi then (
664
- Printf. printf " preferring found resi file for impl: %s\n " pathAsResi;
665
- pathAsResi)
666
- else path
667
- else path
668
- in
654
+ then
655
+ Error
656
+ (Printf. sprintf
657
+ " error: failed to read %s, expected an .res or .resi file" path)
658
+ else
669
659
match Cmt. loadFullCmtFromPath ~path with
670
660
| None ->
671
661
Error
672
662
(Printf. sprintf
673
- " error: failed to generate doc for %s, try to build the project"
674
- path)
675
- | Some full -> Ok (Print_tast. print_full full))
676
- | true ->
677
- Error
678
- (Printf. sprintf
679
- " error: failed to read %s, expected an .res or .resi file" path)
663
+ " error: failed to dump for %s, try to build the project" path)
664
+ | Some full -> Ok (Print_tast. print_full full)
680
665
in
681
666
682
667
result
You can’t perform that action at this time.
0 commit comments