Skip to content

Scala layer for Spacemacs, using lsp + metals instead of ensime.

License

Notifications You must be signed in to change notification settings

zheli/scala-lsp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scala-lsp layer

img/scala.png with img/scalameta.png

Table of Contents

Description

Scala layer for Spacemacs, using lsp instead of ensime, based on the original Scala layer and this pull request https://github.com/syl20bnr/spacemacs/pull/12234/files.

This layer does wonderful things:

  • there is no dependency of ensime, instead we use Metals with language server protocol (lsp)

Install

First make sure you have the latest version of metals-emacs, as of 2019-07-10, the latest version can be built using the following commands:

# 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.7.0 \
  -r bintray:scalacenter/releases \
  -r sonatype:snapshots \
  -o /usr/local/bin/metals-emacs -f

Now, you have to clone the repository in your `~/.emacs.d/private` folder, and then add `scala-lsp` into existing dotspacemacs-configuration-layers list in ~/.spacemacs file.

dotspacemacs-configuration-layers
'(
  ....
  scala-lsp)

I also recommend to add this settings into your Spacemacs config to enable auto completion.

(setq company-lsp-async t)
;; Hack to make sure 'company-lsp is only pushed after company package is loaded
(use-package company
 :config
 (push 'company-lsp company-backends))

Key bindings

See http://develop.spacemacs.org/layers/+tools/lsp/README.html#key-bindings

About

Scala layer for Spacemacs, using lsp + metals instead of ensime.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published