From 19cf4edab4e2fed449fa4a3835c2e3b7d15ec6b1 Mon Sep 17 00:00:00 2001 From: Radon Rosborough Date: Sun, 19 Jul 2020 18:40:24 -0600 Subject: [PATCH] Formatter and LSP for ReasonML --- backend/src/langs.ts | 3 +++ scripts/docker-install-phase5.bash | 6 ++++++ scripts/docker-install-phase7.bash | 8 ++++++++ 3 files changed, 17 insertions(+) diff --git a/backend/src/langs.ts b/backend/src/langs.ts index 942ac89..db135c2 100644 --- a/backend/src/langs.ts +++ b/backend/src/langs.ts @@ -1404,6 +1404,9 @@ main = do main: "main.re", compile: "bsc main.re > main.js", run: "NODE_PATH=/usr/lib/node_modules node main.js", + format: "ocamlformat main.re", + lspSetup: `cp -a /opt/reasonml/project-template/* ./`, + lsp: "reason-language-server", template: `print_string("Hello, world!\\n") `, }, diff --git a/scripts/docker-install-phase5.bash b/scripts/docker-install-phase5.bash index 05cf4a5..9dd070a 100755 --- a/scripts/docker-install-phase5.bash +++ b/scripts/docker-install-phase5.bash @@ -198,6 +198,12 @@ chmod +x /opt/mspyls/Microsoft.Python.LanguageServer ln -s /opt/mspyls/Microsoft.Python.LanguageServer /usr/bin/Microsoft.Python.LanguageServer rm Python-Language-Server-linux-x64.*.nupkg +# ReasonML +wget -nv https://github.com/jaredly/reason-language-server/releases/download/1.7.10/rls-linux.zip +unzip rls-linux.zip +mv rls-linux/reason-language-server /usr/local/bin/ +rm rls-linux.zip + # Scala wget -nv https://git.io/coursier-cli chmod +x coursier-cli diff --git a/scripts/docker-install-phase7.bash b/scripts/docker-install-phase7.bash index ce49026..f4226a7 100755 --- a/scripts/docker-install-phase7.bash +++ b/scripts/docker-install-phase7.bash @@ -26,6 +26,14 @@ popd >/dev/null mkdir /opt/purescript mv project-template /opt/purescript/ +# ReasonML +mkdir -p /opt/reasonml/project-template +pushd /opt/reasonml/project-template >/dev/null +bsb -init . +cat bsconfig.json | jq '.name = "riju-project"' | sponge bsconfig.json +yarn install +popd >/dev/null + # Befunge tee /usr/bin/befunge-repl >/dev/null <<"EOF" #!/usr/bin/env -S NODE_PATH=/usr/lib/node_modules node