Skip to content


Repository files navigation

Presentation compiler examples

These are code samples to go along with my An intro to the Scala Presentation Compiler blog post. They are small standalone examples of how to mimic the LSP textDocument/selectionRange feature from Metals.

Trying them out

You can try out the example by simply running each module via Mill.

For the Scala 3 example


For the Scala 2 example


These will print out the selection ranges for the code provided in the ourScalaCode variable in each of the SelectionRanges.scala files.