scala.md

 1---
 2title: Scala
 3description: "Configure Scala language support in Zed, including language servers, formatting, and debugging."
 4---
 5
 6# Scala
 7
 8Scala language support in Zed is provided by the community-maintained [Scala extension](https://github.com/scalameta/metals-zed).
 9Report issues to: [https://github.com/scalameta/metals-zed/issues](https://github.com/scalameta/metals-zed/issues)
10
11- Tree-sitter: [tree-sitter/tree-sitter-scala](https://github.com/tree-sitter/tree-sitter-scala)
12- Language Server: [scalameta/metals](https://github.com/scalameta/metals)
13
14## Setup
15
16- Install Scala with `cs setup` (Coursier): https://www.scala-lang.org/download/
17  - `brew install coursier/formulas/coursier && cs setup`
18- REPL (Almond) Setup Instructions https://almond.sh/docs/quick-start-install
19  - `brew install --cask temurin` (Eclipse foundation official OpenJDK binaries)
20  - `brew install coursier/formulas/coursier && cs setup`
21  - `coursier launch --use-bootstrap almond -- --install`
22
23## Configuration
24
25Behavior of the Metals language server can be controlled with:
26
27- `.scalafix.conf` file - See [Scalafix Configuration](https://scalacenter.github.io/scalafix/docs/users/configuration.html)
28- `.scalafmt.conf` file - See [Scalafmt Configuration](https://scalameta.org/scalafmt/docs/configuration.html)
29
30You can place these files in the root of your project or specifying their location in the Metals configuration. See [Metals User Configuration](https://scalameta.org/metals/docs/editors/user-configuration) for more.
31
32<!--
33TBD: Provide LSP configuration example for metals in Zed settings.json. metals.{javaHome,excludedPackages,customProjectRoot} etc.
34-->