From 20588bd93e03b7831920e9c5f625c0063b59dd50 Mon Sep 17 00:00:00 2001 From: Cesar Enrique Ramirez Date: Tue, 4 Jun 2024 12:47:56 +0200 Subject: [PATCH] add scala support using scala-cli --- examples/code_blocks.md | 12 ++++++++++++ internal/code/languages.go | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/examples/code_blocks.md b/examples/code_blocks.md index 79c47d2b..7bb2550f 100644 --- a/examples/code_blocks.md +++ b/examples/code_blocks.md @@ -180,3 +180,15 @@ void main() { ```v println('Hello, world!') ``` + +--- + +### Scala + +```scala +//> using dep com.lihaoyi::pprint:0.8.1 + +object Main extends App { + println("Hello") +} +``` diff --git a/internal/code/languages.go b/internal/code/languages.go index 9e48dc82..ed6e5c97 100644 --- a/internal/code/languages.go +++ b/internal/code/languages.go @@ -34,6 +34,7 @@ const ( Swift = "swift" Dart = "dart" V = "v" + Scala = "scala" ) // Languages is a map of supported languages with their extensions and commands @@ -119,4 +120,8 @@ var Languages = map[string]Language{ Extension: "v", Commands: cmds{{"v", "run", ""}}, }, + Scala: { + Extension: "sc", + Commands: cmds{{"scala-cli", "run", ""}}, + }, }