Name
MlStd_Std.Exec - Execute a command in the DkCoder 2.4 runtime environment.
Synopsis
MlStd_Std.Exec [--disable-stdin] [--enable-ocamllsp-logs] [--merlin] [OPTION]… COMMAND [COMMAND_ARGS]…
MlStd_Std.Exec executes a command in the DkCoder runtime environment.
Command: ocamllsp
When the `ocamllsp` command is used, the project is compiled before the `ocamllsp` process is started. The `OCAMLFIND_CONF` environment value will also be set and `--fallback-read-dot-merlin` added to the `ocamllsp` command line if the `--merlin` flag was specified. The expectation is that when opening an IDE (Visual Studio Code, Emacs, Vim, etc.) the source code should be navigable and have type documentation. If the project experiences any compilation failures the `ocamllsp` process is still started.
Setting up visual studio code
Place or merge the following into your project's .vscode/settings.json file:
{
"ocaml.sandbox": {
"kind": "custom",
"template": "${firstWorkspaceFolder}/dk --fixed-length-modules false RunQuiet Ml.Exec --merlin -- $prog $args"
}
}
Arguments
Command to run in the DkCoder runtime environment. You can separate Env options from the Command with a `--`.
COMMAND_ARGS
Command arguments to supply to the COMMAND.
Options
--disable-stdin
Disable the standard input.
--enable-ocamllsp-logs
Enable logs from `ocamllsp` if the COMMAND is `ocamllsp`. By default all logs from `ocamllsp` are silenced so as not to interfere with ocamllsp assuming it has full control over standard output and standard error.
--merlin
The environment variable `OCAMLFIND_CONF` will be set for any invocations of `ocamllsp`. Additionally, `ocamllsp` will be rewritten as `ocamllsp --fallback-read-dot-merlin` so that OCaml LSP ignores Dune configuration files and instead reads the generated `.merlin` file.
Common options
--color=WHEN (absent=auto)
Colorize the output. WHEN must be one of auto, always or never.
--help[=FMT] (default=auto)
Show this help in format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined.
-l LEVEL, --log-level=LEVEL
Set the verbosity of log messages. If the option is repeated the last LEVEL is used. LEVEL must be one of ERROR, WARNING, INFO or DEBUG.
-q, --quiet
Be quiet. Takes precedence over -l and --log-level options.
Exit status
MlStd_Std.Exec exits with:
0
on success.
123
on indiscriminate errors reported on standard error.
124
on command line parsing errors.
125
on unexpected internal errors (bugs).