From db69fde19b80084304b792868a94c0c244fbd681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20Enrique=20Ram=C3=ADrez?= Date: Tue, 4 Jun 2024 16:04:10 +0200 Subject: [PATCH] add scala support using scala-cli (#298) --- 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", ""}}, + }, }