The language server protocol
Your favourite language in you favourite Editor






How does it work
Client Editor


LSP Server
How does it work
Client Editor


LSP Server
object Main{
def adding(a : Int, b : Int) = a + b
val additional = ""
val one = 1
val two = 2
addi_
}How does it work
Client Editor


LSP Server
Completions
object Main{
def adding(a : Int, b : Int) = a + b
val additional = ""
val one = 1
val two = 2
addi_
}How does it work
Client Editor


LSP Server
Completions
object Main{
def adding(a : Int, b : Int) = a + b
val additional = ""
val one = 1
val two = 2
addi_
}How does it work
Client Editor


LSP Server
object Main{
def adding(a : Int, b : Int) = a + b
val additional = ""
val one = 1
val two = 2
addi_
}How does it work
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_
}How does it work
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_
}How does it work
Client Editor


LSP Server

object Main{
def adding(a : Int, b : Int) = a + b
val additional = ""
val one = 1
val two = 2
addi_
}How does it work
Client Editor


LSP Server
object Main{
def adding(a : Int, b : Int) = a + b
val additional = ""
val one = 1
val two = 2
adding(_)
}The build server protocol

The universe of Build tools
Mill




Seed
The universe of Build tools
Mill




Seed

Metals
Mill
Seed





The universe of Build tools

Bloop

LSP Server
BLOOP AND BSP

Bloop

LSP Server
What is this code a part of!

BLOOP AND BSP

Bloop

LSP Server
Which project?
BLOOP AND BSP

Bloop

LSP Server
BLOOP AND BSP
Which project?

Bloop

LSP Server
BLOOP AND BSP

Bloop

LSP Server
Project Foo
BLOOP AND BSP

Bloop

LSP Server
Project Foo
BLOOP AND BSP

Bloop

LSP Server
I don't know how to compile it!

BLOOP AND BSP

Bloop

LSP Server
Compile Foo!
BLOOP AND BSP

Bloop

LSP Server
Compile Foo!
BLOOP AND BSP

Bloop

LSP Server
BLOOP AND BSP

Bloop

LSP Server
Error report
BLOOP AND BSP

Bloop

LSP Server
Error report
BLOOP AND BSP

Bloop

LSP Server
Diagnostics
BLOOP AND BSP
SemanticDB
$ metap .
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).
Used in:
ReferenceProvider
ImplementationProvider
SyntheticDecorationsProvider
Anything that work file wide
Scalameta parser
- used for syntax based feature
- does not require versions specific feature
- easy to implement new features for all ScalaVersions
- FoldingProvider, DocumentSymbolProvider, some code actions
Scala presentation compiler

Scala Presentation Compiler (mtags)
2.13.4 / 2.12.13 / 2.12.12 / 3.0.0-RC1 ...

Java Interfaces

Metals Server (mtags)
- Used for anything that needs to work on newest unsaved version of the code
- Can work in non-compiling code
- Implements one off features that work for a single point
- HoverProvider, SignatureHelpProvider, DefinitionProvider (fallback)
Scala Spree
By Tomek Godzik
Scala Spree
- 557