Hi, I’ve been having some trouble with Ubuntu 20.04
+ VSCodium
(VSCode
) + OCaml Platform
extension for VSCode
+ non-default opam
switch.
Eventually I figured out that pressing Ctrl+Shift+P
(yes with Shift) and typing ocaml
brings up really good commands… I can select the switch to use, I can launch terminal with that switch configured… Pretty cool if not very obvious from the docs.
I still have some questions left
-
is it possible to have
ocamlformat
,ocaml-lsp-server
anddune
installed in one switch and use another to write my hello-world apps?ocamlformat
andcoaml-lsp-server
have pulled in a ton of depdendencies and it would have felt cleaner to use an “empty” switch for development… -
auto-generated
.vscode/tasks.json
looks a bit strange:{ "version": "2.0.0", "tasks": [ { "type": "dune", "problemMatcher": [ "$ocamlc" ], "group": { "kind": "build", "isDefault": true }, "label": "dune: build /dune-project" } ] }
why this?.. the command that ends up being run is
... dune build
so how is it related to the above? -
Is it expected that I have to close/re-open my workspace (“folder”) to pick up changes to
.vscode/.settings.json
?.. -
does it make sense to try to set something like this in
.vscode/settings.json
? This doesn’t work…"ocaml.terminal.shell.linux": "bash -ci 'eval $(opam env --switch dev --set-switch); bash'"
-
what is the best way to run my app from inside VSCodium? Doing
dune exec ./proj1.exe
each time manually from the correct terminal isn’t that much fun -
is there a debugger that’d work in VSCode/VSCodium? or am I asking too much?