package lsp
LSP protocol implementation in OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
jsonrpc-1.6.0.tbz
sha256=35e8c7341f8eb1fa39fb0f0e0701a7ed90b9a0bb89ccf84b7ed997cd258cbec3
sha512=c96a7a3ca845ec193e9edc4a74804a22d6e37efc852b54575011879bd2105e0df021408632219f542ca3ad85b36b5c8b72f2b417204d154d5f0dd0839535afa5
doc/src/lsp.stdune/spawn.ml.html
Source file spawn.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
external sys_exit : int -> 'a = "caml_sys_exit" let rec file_descr_not_standard fd = assert (not Sys.win32); if (Obj.magic (fd : Unix.file_descr) : int) >= 3 then fd else file_descr_not_standard (Unix.dup fd) let safe_close fd = try Unix.close fd with | Unix.Unix_error _ -> () let perform_redirections stdin stdout stderr = let stdin = file_descr_not_standard stdin in let stdout = file_descr_not_standard stdout in let stderr = file_descr_not_standard stderr in Unix.dup2 stdin Unix.stdin; Unix.dup2 stdout Unix.stdout; Unix.dup2 stderr Unix.stderr; safe_close stdin; safe_close stdout; safe_close stderr (** Note that this function's behavior differs between windows and unix. - [Unix.create_process{,_env} prog] looks up prog in PATH - [Unix.execv{_,e} does not look up prog in PATH] *) let spawn ?env ~prog ~argv ?(stdin = Unix.stdin) ?(stdout = Unix.stdout) ?(stderr = Unix.stderr) () = let argv = Array.of_list argv in let env = Option.map ~f:Env.to_unix env in Pid.of_int (if Sys.win32 then match env with | None -> Unix.create_process prog argv stdin stdout stderr | Some env -> Unix.create_process_env prog argv env stdin stdout stderr else match Unix.fork () with | 0 -> ( try ignore (Unix.sigprocmask SIG_SETMASK [] : int list); perform_redirections stdin stdout stderr; match env with | None -> Unix.execv prog argv | Some env -> Unix.execve prog argv env with | _ -> sys_exit 127) | pid -> pid)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>