From d9c23e94503eecc8a0615f3ac22904e06723dcf9 Mon Sep 17 00:00:00 2001 From: Radon Rosborough Date: Sat, 22 Aug 2020 19:47:24 -0600 Subject: [PATCH] WIP: Scala LSP --- backend/src/langs.ts | 3 +++ scripts/docker-install-phase4.bash | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/backend/src/langs.ts b/backend/src/langs.ts index 30a9d2e..3b7a510 100644 --- a/backend/src/langs.ts +++ b/backend/src/langs.ts @@ -2062,6 +2062,9 @@ binding_irb.run(IRB.conf) scope: { code: `val x = 123 * 234`, }, + lsp: { + start: `mkdir -p .cache; [[ -d .cache/coursier ]] || cp -R /opt/coursier/cache .cache/coursier; JAVA_OPTS="-Duser.home=$PWD" metals`, + }, template: `println("Hello, world!") `, timeout: 30, diff --git a/scripts/docker-install-phase4.bash b/scripts/docker-install-phase4.bash index 45c58ce..cce5482 100755 --- a/scripts/docker-install-phase4.bash +++ b/scripts/docker-install-phase4.bash @@ -237,6 +237,16 @@ for file in /opt/rust/bin/*; do ln -s /opt/rust/wrapper "/usr/local/bin/${file##*/}" done +# Scala +file="$(curl -sSL https://scalameta.org/metals/docs/editors/emacs.html | grep -Eo 'org.scalameta[^ ]+')" +wget -nv https://git.io/coursier-cli +chmod +x coursier-cli +mv coursier-cli /usr/local/bin/coursier +coursier bootstrap --java-opt -Xss4m --java-opt -Xms100m --java-opt -Dmetals.client=emacs "${file}" -r bintray:scalacenter/releases -r sonatype:snapshots -o /usr/local/bin/metals +metals -version