Skip to content

logc/escala

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

escala layer

img/escala.png

Table of Contents

Description

This layer adds support for Scala development in Emacs, via Metals and lsp-mode.

It does not depend on Ensime, in contrast to the current official Scala layer.

Features:

  • Documentation for function at point
  • Type hints for value at point
  • SBT integration with a hydra

Install

For the time being

Clone this repository into your .emacs.d/private folder (or wherever your private layers should go), and then add escala to dotspacemacs-configuration-layers in your /.spacemacs

You also need to install the Metals LSP server. Up-to-date instructions can be found on their website, linked further up. As of May 2019, the installation can be summarized as:

# Make sure to use coursier v1.1.0-M9 or newer.
curl -L -o coursier https://git.io/coursier
chmod +x coursier
./coursier bootstrap \
  --java-opt -Xss4m \
  --java-opt -Xms100m \
  --java-opt -Dmetals.client=emacs \
  org.scalameta:metals_2.12:0.5.2 \
  -r bintray:scalacenter/releases \
  -r sonatype:snapshots \
  -o /usr/local/bin/metals-emacs -f

Also, please note that the Metals server, when started from the Spacemacs LSP layer, needs to find Java 8. You can set a local version of Java using jenv, or setting JAVA_HOME within the .spacemacs.env file. **This will also cause sbt to work with Java 8** when using this layer. We are thinking of a workaround …

Once it is an official layer

To use this configuration layer, add it to your ~/.spacemacs. You will need to add escala to the existing dotspacemacs-configuration-layers list in this file.

Key bindings

SBT mode

Key BindingDescription
SPC m b bRun sbt command
SPC m b .Start sbt hydra

LSP mode

Please check the lsp-mode documentation.

About

Scala in Emacs without Ensime

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published