Currently working on Metals as one of the main contributors as a part of the collaboration between VirtusLab and Scala Center.
Client Editor
LSP Server
Client Editor
LSP Server
object Main{
def adding(a : Int, b : Int) = a + b
val additional = ""
val one = 1
val two = 2
addi_
}
Client Editor
LSP Server
Completions
object Main{
def adding(a : Int, b : Int) = a + b
val additional = ""
val one = 1
val two = 2
addi_
}
Client Editor
LSP Server
Completions
object Main{
def adding(a : Int, b : Int) = a + b
val additional = ""
val one = 1
val two = 2
addi_
}
Client Editor
LSP Server
object Main{
def adding(a : Int, b : Int) = a + b
val additional = ""
val one = 1
val two = 2
addi_
}
Client Editor
LSP Server
- adding()
- additional
object Main{
def adding(a : Int, b : Int) = a + b
val additional = ""
val one = 1
val two = 2
addi_
}
Client Editor
LSP Server
- adding()
- additional
object Main{
def adding(a : Int, b : Int) = a + b
val additional = ""
val one = 1
val two = 2
addi_
}
Client Editor
LSP Server
object Main{
def adding(a : Int, b : Int) = a + b
val additional = ""
val one = 1
val two = 2
addi_
}
Client Editor
LSP Server
object Main{
def adding(a : Int, b : Int) = a + b
val additional = ""
val one = 1
val two = 2
adding(_)
}
Mill
Mill
Metals
Mill
Bloop
LSP Server
Bloop
LSP Server
What is this code a part of!
Bloop
LSP Server
Which project?
Bloop
LSP Server
Which project?
Bloop
LSP Server
Bloop
LSP Server
Project Foo
Bloop
LSP Server
Project Foo
Bloop
LSP Server
I don't know how to compile it!
Bloop
LSP Server
Compile Foo!
Bloop
LSP Server
Compile Foo!
Bloop
LSP Server
Bloop
LSP Server
Error report
Bloop
LSP Server
Error report
Bloop
LSP Server
Diagnostics
trait A:
def f: Int
class C(x: Int) extends A:
def f = x
object O:
def f = 3
val x: String = ???
val y: String | Null = ???
x == null // error
x eq null // error
"hello" == null // error
y == null // ok
y == x // ok
@main def helloWorld(
age: Int,
name: String,
others: String*
) = {
println(s"Hello $name!")
println(s"You are $age years old")
}
case class Circle(
x: Double,
y: Double,
radius: Double
)
def (c: Circle).circumference: Double =
c.radius * math.Pi * 2
enum Color(val rgb: Int) {
case Red extends Color(0xFF0000)
case Green extends Color(0x00FF00)
case Blue extends Color(0x0000FF)
}
or
Test.scala
----------
Summary:
Schema => SemanticDB v4
Uri => Test.scala
Text => empty
Language => Scala
Symbols => 3 entries
Occurrences => 7 entries
Symbols:
_empty_/Test. => final object Test extends AnyRef { +1 decls }
_empty_/Test.main(). => method main(args: Array[String]): Unit
_empty_/Test.main().(args) => param args: Array[String]
Occurrences:
[0:7..0:11) <= _empty_/Test.
[1:6..1:10) <= _empty_/Test.main().
[1:11..1:15) <= _empty_/Test.main().(args)
[1:17..1:22) => scala/Array#
[1:23..1:29) => scala/Predef.String#
[1:33..1:37) => scala/Unit#
[2:4..2:11) => scala/Predef.println(+1).
Thanks to the great work by Martin Odersky and Jamie Thompson
Metals Server
Dotty compiler interfaces
RENAME SYMBOL
via coursier
> cs install giter8
> g8 lampepfl/dotty.g8
> cd dotty
> code .
via coursier
> cs install giter8
> g8 lampepfl/dotty.g8
> cd dotty
> code .
via new project wizard (coming soon)
object Main {
def main(args: Array[String]) {
val name: Option[String] = Some("Anne")
name
match {
case None => println("Hello <unknown>")
case Some(x) => println(s"Hello $x")
}
}
}
object Main {
def main(args: Array[String]) {
val name: Option[String] = Some("Anne")
name
match {
case None => println("Hello <unknown>")
case Some(x) => println(s"Hello $x")
}
}
}
object Main {
def main(args: Array[String]) {
val name: Option[String] = Some("Anne")
name match {
case None => println("Hello <unknown>")
case Some(x) => println(s"Hello $x")
}
}
object Main {
def main(args: Array[String]) {
val name: Option[String] = Some("Anne")
name
match {
case None => println("Hello <unknown>")
case Some(x) => println(s"Hello $x")
}
}
}
object Main {
def main(args: Array[String]) {
val name: Option[String] = Some("Anne")
name match {
case None => println("Hello <unknown>")
case Some(x) => println(s"Hello $x")
}
}
- ExplicitResultTypes
- NoAutoTupling
- RemoveUnused
- DisableSyntax
- LeakingImplicitClassVal
- NoValInForComprehension
- ProcedureSyntax
- folding ranges
- document symbols
- breakpoints
- formatting (scalafmt)
- tokenizing the code
- finding definition in dependencies
Last year Scala Days talk by Ólafur Páll Geirsson
https://tinyurl.com/metals-scala
Presentation: https://slides.com/tomekgodzik/scala3-tooling
Metals documentation: https://scalameta.org/metals/
Bloop documentation: https://scalacenter.github.io/bloop/
Shout at me on Twitter: @TomekGodzik
OR
Ask me about anything on gitter/discord!