File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,11 @@ end = struct
9999 let load_merlin_file file =
100100 (* We search for an appropriate merlin configuration in the current
101101 directory and its parents *)
102+ let get_file_config_at_path p =
103+ match Merlin.Processed. load_file p with
104+ | Error msg -> Some (Merlin_conf. make_error msg)
105+ | Ok config -> Merlin.Processed. get config ~file
106+ in
102107 let basename = Path.Build. set_extension file ~ext: " " |> Path.Build. basename in
103108 let good_names =
104109 List. map
@@ -118,18 +123,14 @@ end = struct
118123 with
119124 | Some p ->
120125 (* Found exact match: we are done *)
121- (match Merlin.Processed. load_file p with
122- | Error msg -> Some (Merlin_conf. make_error msg)
123- | Ok config -> Merlin.Processed. get config ~file )
126+ get_file_config_at_path p
124127 | None ->
125128 (* looking for approximate match *)
126129 (match
127130 List. find_map merlin_paths ~f: (fun file_path ->
128131 (* FIXME we are racing against the build system writing these
129132 files here *)
130- match Merlin.Processed. load_file file_path with
131- | Error msg -> Some (Merlin_conf. make_error msg)
132- | Ok config -> Merlin.Processed. get config ~file )
133+ get_file_config_at_path file_path)
133134 with
134135 | Some p -> Some p
135136 | None ->
You can’t perform that action at this time.
0 commit comments