Skip to content

Commit f6bc532

Browse files
authored
Merge pull request #2523 from VirtusLab/stable
Back port of documentation changes to main
2 parents 6763bbd + 2220656 commit f6bc532

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

website/docs/cookbooks/emacs.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: Scala CLI within Emacs
3+
sidebar_position: 14
4+
---
5+
6+
Emacs users can make it easier to use Scala CLI from within their editor by
7+
loading an extension: <https://github.com/ag91/scala-cli-repl>.
8+
9+
That lets you send Scala code directly from your buffer to the Scala REPL.
10+
11+
![scala-cli-repl-demo](/img/scala-cli-repl.jpg)
12+
13+
The extension also facilitates [literate
14+
programming](https://en.wikipedia.org/wiki/Literate_programming) using
15+
[Org Mode](https://orgmode.org/), by letting the user experiment with
16+
source blocks looking like the following.
17+
18+
``` org
19+
#+begin_src scala :scala-version 3.0.0 :dep '("com.lihaoyi::os-lib:0.9.0")
20+
println("This is:" + os.pwd)
21+
#+end_src
22+
#+end_src
23+
```
24+
25+
In the above you can see that you can select the Scala version and
26+
dependencies you need for your code.
27+
28+
The users who use [lsp-metals](https://github.com/emacs-lsp/lsp-metals)
29+
can also enable lsp support within a source block to access utilities as
30+
completion and navigation from within the Org Mode file.

website/docs/cookbooks/intro.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ To get started, try one of the cookbooks below:
2929
- [IDEA IntelliJ](./intellij.md)
3030
- [Scala CLI alongside SBT in IDEA IntelliJ](./intellij-sbt-with-bsp.md)
3131
- [Multiple Scala CLI projects as separate modules in IDEA IntelliJ](./intellij-multi-bsp.md)
32+
- [Scala CLI within Emacs](./emacs.md)
3233

3334
## Packaging ⚡️
3435

website/static/img/scala-cli-repl.jpg

81.3 KB
Loading

0 commit comments

Comments
 (0)