File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
ocaml-lsp-server/vendor/merlin/src Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 1414 -open Merlin_specific
1515 -open Merlin_extend)
1616 (libraries merlin_config os_ipc ocaml_parsing ocaml_preprocess ocaml_typing ocaml_utils
17- merlin_extend merlin_specific merlin_utils merlin_dot_protocol))
17+ merlin_extend merlin_specific merlin_utils merlin_dot_protocol spawn ))
1818
1919(rule
2020 (targets standard_library.ml)
Original file line number Diff line number Diff line change @@ -46,7 +46,19 @@ let merlin_system_command =
4646 windows_merlin_system_command
4747 else
4848 fun cmd ~cwd ->
49- Sys. command (Printf. sprintf " cd %s && %s" (Filename. quote cwd) cmd)
49+ let prog = " /bin/bash" in
50+ let argv = [" sh" ; " -c" ; cmd] in
51+ let stdin = Unix. openfile " /dev/null" [ Unix. O_RDONLY ] 0x777 in
52+ let pid = Spawn. spawn ~prog ~argv ~stdin ~stdout: Unix. stderr ~stderr: Unix. stderr () in
53+ let (_, status) = Unix. waitpid [] pid in
54+ let res =
55+ match (status : Unix.process_status ) with
56+ | WEXITED n -> n
57+ | WSIGNALED _ -> - 1
58+ | WSTOPPED _ -> - 1
59+ in
60+ Unix. close stdin;
61+ res
5062
5163let ppx_commandline cmd fn_in fn_out =
5264 Printf. sprintf " %s %s %s%s"
You can’t perform that action at this time.
0 commit comments