Metals works with the following text editors with varying degree of functionality.
|Editor||Installation||Build import||Diagnostics||Goto definition||Find references||Document symbols||Formatting||Metals Extensions|
|Visual Studio Code||Single click||Built-in||✅||✅||✅||✅||✅||✅|
|Vim||Few steps||Built-in||Escaped newlines||✅||✅||Flat||Status bar|
|Sublime Text 3||Few steps||Requires browser||✅||✅||✅||Flat||✅|
|Emacs||Few steps||Built-in||Single buffer||✅||✅||✅||✅||Status bar|
Metals is a new project with limited features. If you are learning Scala or are looking for a rich IDE experience it is recommended to use IntelliJ instead.
Single click: Metals is easy to install and requires minimal configuration out-of-the-box.
Few steps: installing Metals requires a few custom steps and minimal configuration to work.
Compile from source: installing Metals requires building an editor plugin from source.
Built-in: it is possible to import a build such as an sbt project directly from the editor.
Requires browser: importing a build requires additional steps in a web browser using a localhost server. It is not possible to import a build within the editor.
✅: Diagnostics are correctly published on compile.
Escaped newlines: Multi-line diagnostic are slightly difficult to read since
newlines are escaped into
Single buffer: Diagnostics are only published for the current buffer so compile errors are lost for unopened files.
Compile errors are reported as red squiggles in the editor. Compilation is triggered on file save for the build target (project/module) containing the focused text file.
- Slow feedback. Compilation is handled by the build tool, meaning diagnostics may take a while to publish for large projects. The batch compilation mode used by build tools is slower than the interactive compiler used by IntelliJ as you type.
Navigate to symbol definitions for project sources and Scala/Java library dependencies.
Symbols are resolved according to the last successful compilation in the build tool and navigation continues to work despite syntax errors in the open unsaved buffer.
- Navigation does not work for identifiers that have just been typed in unsaved editor buffer. An identifier must compile successfully at least once in order to resolve to a definition.
- Navigation does not work for buffers that do not tokenize, for example due to unclosed string literals.
- scalameta/scalameta#1780 extension methods sometimes resolve to the implicit conversion method instead of the extension method.
- scalameta/scalameta#1802 reflective invocations (methods calls on structural types) do not resolve to a definition.
Find symbol references in project sources. References include implicits,
.flatMap from for comprehensions and other
symbols that may not be explicitly written in source, making it possible to
discover usages of difficult-to-grep symbols. The Metals navigation index is
low-overhead and should only require a few megabytes of memory even for large
✅: Document symbols are displayed in a hierarchical outline.
Flat: Document symbols are displayed in a flat outline.
Metals uses Scalafmt to respond to formatting requests from the editor,
according to the configuration defined in
Learn how to configure Scalafmt at https://scalameta.org/scalafmt/docs/configuration.html.
Status bar: Editor client implements the
Did focus: Editor client implements the
Slow task: Editor client implements the
Input box: Editor client implements the
✅: Editor implements all Metals extension endpoints.
The Metals language server supports custom extensions that are not part of the Language Server Protocol (LSP). These extensions are not necessary for Metals to function but they improve the user experience. To learn more about Metals extensions, see integrating a new editor.
Metals does not support the following features:
- Show type of expression
- Show symbol docstring
- Rename symbol
- Remove unused imports
- Refactoring with Scalafix