Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back port of documentation changes to main #2523

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions website/docs/cookbooks/emacs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: Scala CLI within Emacs
sidebar_position: 14
---

Emacs users can make it easier to use Scala CLI from within their editor by
loading an extension: <https://github.com/ag91/scala-cli-repl>.

That lets you send Scala code directly from your buffer to the Scala REPL.

![scala-cli-repl-demo](/img/scala-cli-repl.jpg)

The extension also facilitates [literate
programming](https://en.wikipedia.org/wiki/Literate_programming) using
[Org Mode](https://orgmode.org/), by letting the user experiment with
source blocks looking like the following.

``` org
#+begin_src scala :scala-version 3.0.0 :dep '("com.lihaoyi::os-lib:0.9.0")
println("This is:" + os.pwd)
#+end_src
#+end_src
```

In the above you can see that you can select the Scala version and
dependencies you need for your code.

The users who use [lsp-metals](https://github.com/emacs-lsp/lsp-metals)
can also enable lsp support within a source block to access utilities as
completion and navigation from within the Org Mode file.
1 change: 1 addition & 0 deletions website/docs/cookbooks/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ To get started, try one of the cookbooks below:
- [IDEA IntelliJ](./intellij.md)
- [Scala CLI alongside SBT in IDEA IntelliJ](./intellij-sbt-with-bsp.md)
- [Multiple Scala CLI projects as separate modules in IDEA IntelliJ](./intellij-multi-bsp.md)
- [Scala CLI within Emacs](./emacs.md)

## Packaging ⚡️

Expand Down
Binary file added website/static/img/scala-cli-repl.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading