Metals!

Your next IDE?

Questions!

Go to sli.do

 

Enter code: #metals

 

Ask your 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.

Who is working on metals?

and many more contributors from the community!

Who is working on metals?

and many more contributors from the community!

Author

Metals - Scala language server with rich ide features

Editor gap

Your favourite language in you favourite Editor

How does it work?

How does it work?

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

Build tools

Mill

Seed

Build tools

Mill

Seed

Bloop

- Bloop is a Scala build server

- Serves requests via build server protocol

- gives us information about the build

- uses json configuration files

 

 

Build import

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

Compile on save

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 <- need to be correct and fast

Scala presentation compiler

- We get it for free by depending on the scala compiler

- Used by Ammonite, Repl, ScalaIDE

- implements Scope and member completions

- quite fast

Optimizations

- cache presentation compiler - 90ms vs 40 ms 

- disabled compiler plugins  (aside from 2)

- disabled blackbox macros

- cancellation

- restart in case of issues

Pieces to the puzzle

- Build tools <- CONNECTS VIA BSP

- semantic information <- semanticDB, we have bloop!

- SCALA PRESENTATION COMPILER <- fast and correct

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

Metals in action - Definition/references

Metals in action - formatting

Metals in action - Vim

Metals in action - emacs

Metals in action - atom

Metals in action - sublime

Metals in action - eclipse

Works also in eclipse Theia!

Works also in eclipse Theia!

New!

Available in latest SNAPSHOT

easier import

  1. Metals sends information about SemanticDB version.
  2. Bloop tries to resolve it and adds to workspace settings.
  3. SemanticDB files are created on compile.

 

Goto implementation

- new class inheritance index

- no noticable impact on indexing

- works with overloaded methods

- for workspace and library symbols

Goto implementation

Debug adapter protocol

- GENERIC DEBUGGER FOR A DEVELOPMENT TOOL 

- implemented in Bloop

- Metals serves as proxy

- next release only run/test

 

Debug adapter protocol

run/test

run/test- there is More!

Next on the roadmap

- go to type definition

- rename symbol

- debugging with breakpoints

- better test interface

- DOTTY (SCALA 3) SUPPORT

- PANTS SUPPORT

- worksheets

Future work

Questions?

Recent Scala Days talk by Ólafur Páll Geirsson

https://tinyurl.com/metals-scala

 

Presentation: https://slides.com/tomekgodzik/metals-1


Metals documentation: https://scalameta.org/metals/

 

Bloop documentation: https://scalacenter.github.io/bloop/

 

Shout at me on Twitter: @TomekGodzik  

Questions?

Metals - your next ide?

By Tomek Godzik

Metals - your next ide?

  • 172