Formatter and LSP for OCaml

This commit is contained in:
Radon Rosborough 2020-07-19 18:22:22 -06:00
parent 621a05fe4d
commit 2a03208fda
3 changed files with 16 additions and 1 deletions

View File

@ -1158,6 +1158,9 @@ int main() {
main: "main.ml",
repl: "ocaml",
run: "ocaml -init main.ml",
format: "ocamlformat main.ml",
lsp: "ocamllsp",
lspLang: "ocaml",
template: `print_string "Hello, world!\\n";;
`,
},

View File

@ -33,8 +33,9 @@ yarn
gcc
gnustep-devel
# Ocaml
# OCaml
ocaml
opam
# Octave
octave

View File

@ -8,6 +8,11 @@ set -x
mkdir /opt/julia
export JULIA_DEPOT_PATH=/opt/julia
# Package manager - OCaml
export OPAMROOT=/opt/opam
export OPAMROOTISOK=1
opam init -n --disable-sandboxing
# Package manager - Node.js
npm config set unsafe-perm true
PERL_MM_USE_DEFAULT=1 cpan App::cpanminus
@ -67,6 +72,12 @@ npm install -g less
# LiveScript
npm install -g livescript
# OCaml
opam install -y ocamlformat
opam pin add -y ocaml-lsp-server https://github.com/ocaml/ocaml-lsp.git
ln -s /opt/opam/default/bin/ocamlformat /usr/local/bin/ocamlformat
ln -s /opt/opam/default/bin/ocamllsp /usr/local/bin/ocamllsp
# Perl
cpanm -n Devel::REPL