Editors: IntelliJ IDEA and Metals
A plain text editor can save a .scala file, but it cannot tell you that weekTotal is a Double, or that you misspelled runs, until you run the program. A Scala-aware editor shows these things while you type. There are many editors to choose from, but only two engines behind them.
The rule
Two engines: IntelliJ's Scala plugin, or Metals for every other editor.
IntelliJ IDEA from JetBrains supports Scala through its own Scala plugin, installed from the plugin settings. The plugin brings its own code analysis, so it needs nothing else.
Metals is a language server for Scala: a background program that understands your code and answers questions such as "what type is this?" or "where is this defined?". Editors talk to it through the Language Server Protocol, a shared standard. That is why one engine can serve many editors:
- VS Code: install the extension named Scala (Metals).
- Vim and Neovim, Emacs, Sublime Text and Zed: each connects to Metals through a language-server plugin.
Either engine gives you the same core help:
- errors underlined as you type, before running anything
- the inferred type when you hover over a name
- completion of method names after a dot
- jump to definition, and safe renaming across files
Both also offer worksheets: files where each line's value appears beside it when you save. In IntelliJ you create a Scala Worksheet, a .sc file. With Metals, the file name must end in .worksheet.sc, as in pace.worksheet.sc. A worksheet is a REPL session you can keep.
When you open a project folder, Metals looks for the build (a Scala CLI project, sbt or Mill) and offers to import it. Accept, and let the import finish before judging whether the features work.
The shortcut
Choose by habit, then prove it with one hover. If you already live in IntelliJ, add the Scala plugin; otherwise use Metals in the editor you know. Then hover over a name: if the inferred type appears, the setup is working.
Install the extension
Search the extensions panel for Scala (Metals) and install it.
The trap: judging the editor too early. While the build import is still running, hovers and error marks are missing, which looks exactly like a broken setup.
Drills
Answer fast — trust the rule.
Which piece gives VS Code its Scala features?
A club member edits code in Neovim. How can they get Scala completion and error marks?
In VS Code with Metals, what is special about a file named pace.worksheet.sc?
Where does IntelliJ IDEA's Scala support come from?
You just opened the project, and hovering shows nothing. What should you check first?
Remember
- IntelliJ IDEA uses its own Scala plugin; VS Code, Vim, Emacs, Sublime Text and Zed use Metals.
- Shortcut: pick by habit, then hover over a name to prove the setup works.
- Trap: judging the setup before the build import finishes.
