Skip to content

Commit

Permalink
refactor: move path canonicalization to caller
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrinberg committed May 12, 2022
1 parent 150d54a commit 55d06b2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ocaml-lsp-server/src/merlin_config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,7 @@ module Process = struct
let* stdin = make stdin_w Output in
let+ stdout = make stdout_r Input in
let session = Lev_fiber_csexp.Session.create ~socket:false stdout stdin in
let initial_cwd = Misc.canonicalize_filename dir in
{ pid; initial_cwd; stdin; stdout; session }
{ pid; initial_cwd = dir; stdin; stdout; session }
end

module Dot_protocol_io =
Expand Down Expand Up @@ -319,7 +318,9 @@ let find_project_context start_dir =
List.find_map [ "dune-project"; "dune-workspace" ] ~f:(fun f ->
let fname = Filename.concat dir f in
if file_exists fname then
let workdir = Option.value ~default:dir workdir in
let workdir =
Misc.canonicalize_filename (Option.value ~default:dir workdir)
in
Some ({ workdir; process_dir = dir }, fname)
else None)
with
Expand Down

0 comments on commit 55d06b2

Please sign in to comment.