This project is an experiment to implement a Language Server for Scala using Scalameta semanticdb and the Scala presentation compiler.
This project has the following goals:
- a good UX for the final users, including simple installation and setup
- low memory requirements
- integration with scalameta-based tools, such as Scalafix and Scalafmt
Below is a rough summary of what features have been implemented. Even if some checkbox is marked it does not mean that feature works perfectly. Some of those features are a likely outside the scope of this project, we are still learning and exploring what's possible.
- Compile errors with the Scala Presentation Compiler (
textDocument/publishDiagnostics
):- On build compile
- As you type
- Integration with the sbt server:
- Run custom sbt command on save
- Receive compilation errors (
textDocument/publishDiagnostics
)
- Linting with Scalafix (
textDocument/publishDiagnostics
):- On build compile
- As you type
- Refactoring with Scalafix:
- Quick-fix inspections (
textDocument/codeAction
)- Remove unused imports
- Rename local symbol (
textDocument/rename
) - Rename global symbol (
textDocument/rename
)
- Quick-fix inspections (
- Formatting with Scalafmt:
- Whole file (
textDocument/formatting
) - Selected range (
textDocument/rangeFormatting
) - On save (
textDocument/willSaveWaitUntil
) - As you type (
textDocument/onTypeFormatting
)
- Whole file (
- Code assistance:
- Auto-complete symbols in scope as you type (
textDocument/completions
) - Auto-complete global symbol and insert missing imports (
textDocument/completions
) - Show parameter list as you type (
textDocument/signatureHelp
) - Show type at position (
textDocument/hover
)
- Auto-complete symbols in scope as you type (
- Go to definition with SemanticDB (
textDocument/definition
):- Inside the project
- From project files to Scala dependency source files
- From project files to Java dependency source files
- From project dependency to project dependency
- Find references with SemanticDB (
textDocument/references
):- In file (
textDocument/documentHighlight
) - In project
- In dependencies
- In file (
- Lookup symbol definition by name:
- In file (
textDocument/documentSymbol
) - In workspace (
workspace/symbol
)
- In file (
- Symbol outline:
- In file as you type (
textDocument/documentSymbol
)
- In file as you type (
See the contributing guide.
The current maintainers (people who can merge pull requests) are:
- Alexey Alekhin -
@laughedelic
- Gabriele Petronella -
@gabro
- Jorge Vicente Cantero -
@jvican
- Ólafur Páll Geirsson -
@olafurpg
- Shane Delmore -
@ShaneDelmore
Huge thanks to @dragos
for his work on a Scala implementation of the LSP (see: https://github.com/dragos/dragos-vscode-scala).
This project helped us get quickly started with LSP.
Since then, we have refactored the project's original sources to the
point where only a few simple case classes remain.
- ENSIME: a tool for providing IDE-like features to text editors, that recently added LSP support
Metals = Meta (from Scalameta) + LS (from Language Server)