Skip to content

Commit 55d06b2

Browse files
committed
refactor: move path canonicalization to caller
1 parent 150d54a commit 55d06b2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ocaml-lsp-server/src/merlin_config.ml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,7 @@ module Process = struct
195195
let* stdin = make stdin_w Output in
196196
let+ stdout = make stdout_r Input in
197197
let session = Lev_fiber_csexp.Session.create ~socket:false stdout stdin in
198-
let initial_cwd = Misc.canonicalize_filename dir in
199-
{ pid; initial_cwd; stdin; stdout; session }
198+
{ pid; initial_cwd = dir; stdin; stdout; session }
200199
end
201200

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

0 commit comments

Comments
 (0)