Awesome experience with scala on eclipse
Questions!
Why am I Here?
Currently working on Metals as one of the main contributors as a part of the collaboration between VirtusLab and Scala Center.
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6619432/scalacenter.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6619438/virtuslab.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6619434/metals.png)
Who is working on metals?
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6619784/gabriele.jpeg)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6619785/marek.jpeg)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6619783/jorge.jpeg)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6619782/olafur.jpeg)
and many more contributors from the community!
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6685411/mundacho.jpeg)
Metals - Scala language server with rich ide features
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6619434/metals.png)
Your favourite language in you favourite Editor
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6619858/vscode.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6619857/eclipse.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6619856/atom.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6619867/vim.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6619871/emacs.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6619875/sublime.png)
How does it work?
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6620500/trace_024.png)
How does it work?
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6620501/trace_025.png)
Pieces to the puzzle
- Build tools
- semantic information
- Scala presentation compiler
Pieces to the puzzle
- Build tools <- A LOT OF THEM
- semantic information
- SCALA PRESENTATION COMPILER
![](https://media0.giphy.com/media/5YuhLwDgrgtRVwI7OY/giphy.gif)
Build tools
Mill
Seed
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6620027/sbt.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6620024/fury.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6620026/maven.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6620025/gradle.png)
Build tools
Mill
Seed
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6620027/sbt.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6620024/fury.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6620026/maven.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6620025/gradle.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6620029/impure-logo-bloop.png)
Bloop
- Bloop is a Scala build server
- Serves requests via build server protocol
- gives us information about the build
- uses json configuration files
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6620029/impure-logo-bloop.png)
Pieces to the puzzle
- Build tools <- connects VIA BSP
- semantic information
- SCALA PRESENTATION COMPILER
Pieces to the puzzle
- Build tools <- CONNECTS VIA BSP
- semantic information <- semanticDB, but on compile...
- SCALA PRESENTATION COMPILER
Compile on save
- "hot" Bloop compiler
- fast feedback
- same errors as in the build tool
- SemanticDB files created
![](https://media0.giphy.com/media/3o72FfM5HJydzafgUE/giphy.gif)
Compile on save
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6686269/eclipse-save.gif)
Pieces to the puzzle
- Build tools <- CONNECTS VIA BSP
- semantic information <- semanticDB, we have bloop!
- SCALA PRESENTATION COMPILER
Pieces to the puzzle
- Build tools <- CONNECTS VIA BSP
- semantic information <- semanticDB, we have bloop!
- SCALA PRESENTATION COMPILER <- can end up in bad state
Scala presentation compiler
- We get it for free by depending on the scala compiler
- Used by Ammonite, Repl, ScalaIDE
- we can discard it whenever we want
- run in a separate thread
Pieces to the puzzle
- Build tools <- CONNECTS VIA BSP
- semantic information <- semanticDB, we have bloop!
- SCALA PRESENTATION COMPILER <- Discard thread with Pc
What is already implemented
- completions
-hover
- signature Help
- go to definition
- references
-diagnostics
-document Highlight
- document Symbol
- folding Range
- FORMATTING
- RANGE FORMATTING
- ON TYPE FORMATTING
- document Highlight
- tons of smaller features
In snapshot:
- implementation
- codeLens
- run/test
Metals in action - Completions
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6686299/compl-eclipse.gif)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6686299/compl-eclipse.gif)
Metals in action - Definition/hover
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6686376/goto.gif)
Works also in eclipse Theia!
Go to:
https://gitpod.io/#https://github.com/tgodzik/metals-mill-sample
and try Metals for yourself!
New!
Available in latest SNAPSHOT
easier import
- Metals sends information about SemanticDB version.
- Bloop tries to resolve it and adds to workspace settings.
- SemanticDB files are created on compile.
![](https://media1.giphy.com/media/MOWPkhRAUbR7i/giphy.gif)
Goto implementation
- new class inheritance index
- no noticable impact on indexing
- works with overloaded methods
- for workspace and library symbols
Goto implementation
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6686768/impl-theia.gif)
Debug adapter protocol
- GENERIC DEBUGGER FOR A DEVELOPMENT TOOL
- implemented in Bloop
- Metals serves as proxy
- currently only run/test
Debug adapter protocol
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6620789/dap-sequence.png)
run/test
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6686839/run-eclipse.gif.gif)
Next on the roadmap
- go to type definition
- rename symbol
- debugging with breakpoints
- better test interface
- dotty (Scala 3) support
- pants support
Future work
![](https://s3.amazonaws.com/media-p.slid.es/uploads/1147195/images/6623668/Selection_024.png)
Questions?
Recent Scala Days talk by Ólafur Páll Geirsson https://www.youtube.com/watch?v=MRQMylDxBJ8
Metals documentation:
Bloop documentation:
https://scalacenter.github.io/bloop/
Shout at me on Twitter: @TomekGodzik
Questions?
Awesome experience with Scala on Eclipse
By Tomek Godzik
Awesome experience with Scala on Eclipse
- 149