https://github.com/emacs-lsp/lsp-metals
lsp-mode :heart: metals
https://github.com/emacs-lsp/lsp-metals
emacs-lsp lsp lsp-client lsp-metals lsp-mode melpa metals scala
Last synced: 6 months ago
JSON representation
lsp-mode :heart: metals
- Host: GitHub
- URL: https://github.com/emacs-lsp/lsp-metals
- Owner: emacs-lsp
- License: gpl-3.0
- Created: 2020-05-11T12:29:20.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-04-23T01:20:19.000Z (8 months ago)
- Last Synced: 2025-06-16T05:46:02.999Z (6 months ago)
- Topics: emacs-lsp, lsp, lsp-client, lsp-metals, lsp-mode, melpa, metals, scala
- Language: Emacs Lisp
- Homepage: https://emacs-lsp.github.io/lsp-metals
- Size: 1.7 MB
- Stars: 63
- Watchers: 10
- Forks: 34
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://melpa.org/#/lsp-metals)
[](https://stable.melpa.org/#/lsp-metals)

# lsp-metals
[](https://github.com/emacs-lsp/lsp-metals/actions)
[](https://gitter.im/emacs-lsp/lsp-mode)
Emacs Scala IDE using [lsp-mode](https://github.com/emacs-lsp/lsp-mode) to connect to [Metals](https://scalameta.org/metals).
## Quickstart
An example to setup `lsp-metals` using `use-package`:
```elisp
(use-package lsp-metals
:ensure t
:custom
;; You might set metals server options via -J arguments. This might not always work, for instance when
;; metals is installed using nix. In this case you can use JAVA_TOOL_OPTIONS environment variable.
(lsp-metals-server-args '(;; Metals claims to support range formatting by default but it supports range
;; formatting of multiline strings only. You might want to disable it so that
;; emacs can use indentation provided by scala-mode.
"-J-Dmetals.allow-multiline-string-formatting=off"
;; Enable unicode icons. But be warned that emacs might not render unicode
;; correctly in all cases.
"-J-Dmetals.icons=unicode"))
;; In case you want semantic highlighting. This also has to be enabled in lsp-mode using
;; `lsp-semantic-tokens-enable' variable. Also you might want to disable highlighting of modifiers
;; setting `lsp-semantic-tokens-apply-modifiers' to `nil' because metals sends `abstract' modifier
;; which is mapped to `keyword' face.
(lsp-metals-enable-semantic-highlighting t)
:hook (scala-mode . lsp))
```