:lang scala

Java, but good

1. Description

This module adds scala and sbt support to Emacs.

1.1. Maintainers

This module has no dedicated maintainers. Become a maintainer?

1.2. Module flags

+lsp
Enable LSP support for scala-mode. Requires :tools lsp and a langserver (supports Metals).

1.4. Hacks

No hacks documented for this module.

2. Prerequisites

2.1. Coursier

Unless you’re running Arch Linux, Coursier is required to install Metals.

2.1.1. Ubuntu / Debian / Fedora

$ curl -fLo cs https://git.io/coursier-cli-linux &&
      chmod +x cs &&
      ./cs

2.1.2. macOS

$ curl -fLo cs https://git.io/coursier-cli-macos &&
      chmod +x cs &&
      (xattr -d com.apple.quarantine cs || true) &&
      ./cs

2.1.3. Arch Linux

$ yay -S coursier

2.2. Metals

2.2.1. Ubuntu / Debian / Fedora / MacOS

Note: Update following command to latest version of metals found here.

$ coursier bootstrap \
    --java-opt -Xss4m \
    --java-opt -Xms100m \
    --java-opt -Dmetals.client=emacs \
    org.scalameta:metals_2.12:0.9.4 \
    -r bintray:scalacenter/releases \
    -r sonatype:snapshots \
    -o /usr/local/bin/metals-emacs -f

2.2.2. Arch Linux

$ yay -S metals

3. Usage

This module’s usage documentation is incomplete. Complete it?

According to https://scalameta.org/metals/docs/editors/overview.html it adds

  • Goto Definition
  • Completions
  • Hover
  • Paremeter Hints
  • Find References
  • Run/Debug
  • Find Implementations
  • Rename Symbol
  • Code Actions
  • Document Symbols
  • Formatting
  • Folding
  • Organize Imports

3.1. Notes

4. TODO Configuration

This module has no configuration documentation yet. Write some?

5. Troubleshooting

There are no known problems with this module. Report one?

6. TODO Appendix

This module has no appendix yet. Write one?