### Start shadow-cljs REPL and Connect
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/shadow-cljs.md
Steps to jack-in a shadow-cljs project with Calva, selecting the :app build and connecting to it. Assumes project setup with npm install.
```clojure
Calva: Start a Project REPL and Connect (a.k.a. Jack-in)
shadow-cljs
:app
:app
```
--------------------------------
### Start Polylith RealWorld Server REPL
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/polylith.md
Evaluate this command in the REPL to start the server for the Polylith RealWorld example. Ensure Calva is connected to the REPL.
```clojure
(start! 6003)
```
--------------------------------
### Install and Watch Project Dependencies
Source: https://github.com/betterthantomorrow/calva/blob/published/test-data/projects/shadow-w-backend2/README.md
Installs project dependencies using Yarn and starts a watch process for development.
```shell
yarn install
yarn watch
```
--------------------------------
### Example Project Structure
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/workspace-layouts.md
Calva can detect project roots even when they are in subdirectories, such as `backend/` in this example.
```text
my-workspace/
backend/
deps.edn
src/
app.clj
```
--------------------------------
### Manually Start ClojureScript Node REPL
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/jack-in-guide.md
This example demonstrates how to manually start a ClojureScript REPL for Node.js by requiring the necessary namespace and then calling the cljs-repl function with a repl-env. This is useful for understanding the connection process when using custom connect sequences.
```clojure
user=> (require 'cljs.repl.node)
user=> (cider.piggieback/cljs-repl (cljs.repl.node/repl-env))
ClojureScript 1.10.844
To quit, type: :cljs/quit
nil
cljs.user=> |
```
--------------------------------
### Install MkDocs and Material
Source: https://github.com/betterthantomorrow/calva/wiki/Run-Calva-in-Development-Mode
Install MkDocs and the Material theme using pip. This is required for building and serving the Calva documentation locally.
```shell
pip install -r requirements.txt
```
--------------------------------
### Install MkDocs and Material with Python 3.7
Source: https://github.com/betterthantomorrow/calva/wiki/Run-Calva-in-Development-Mode
If you encounter issues with the standard pip install, try using python3.7 to install MkDocs and the Material theme.
```shell
python3.7 -m pip install -r requirements.txt
```
--------------------------------
### Start nREPL Server with Gradle
Source: https://github.com/betterthantomorrow/calva/blob/published/test-data/projects/my-gradle/README.md
Launch an nREPL server for the project using the Gradle wrapper.
```bash
./gradlew clojureRepl
```
--------------------------------
### Compile Clojure Warrior Extension
Source: https://github.com/betterthantomorrow/calva/blob/published/src/highlight/README.md
Commands to install dependencies and start the watch process for compiling the Clojure Warrior extension.
```bash
cd clojure-warrior
npm install
npm run watch
```
--------------------------------
### Start nREPL Server with Reveal Middleware
Source: https://github.com/betterthantomorrow/calva/blob/published/test-data/projects/minimal-reveal/README.md
Use this command to start an nREPL server with the Reveal middleware. Ensure you have the necessary dependencies specified in the deps.edn file.
```sh
clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"1.0.0"},cider/cider-nrepl {:mvn/version,"0.28.5"}}}' -A:reveal-nrepl-middleware
nREPL server started on port ... on host localhost - nrepl://localhost:...
```
--------------------------------
### Complete Paredit Configuration Example
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/paredit.md
A comprehensive example combining custom pair forms and alias mapping for `promesa.core/let` to enable Paredit's pair-aware editing features.
```json
{
"calva.paredit.customPairForms": [
{ "type": "vector-binding", "name": "promesa.core/let" }
],
"calva.paredit.aliasMap": {
"p": "promesa.core"
}
}
```
--------------------------------
### Joyride Command for deps.edn Jack-in
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/customizing-jack-in-and-connect.md
A Joyride script example for starting a REPL for a deps.edn project in the workspace root, prompting for aliases.
```clojure
(vscode/commands.executeCommand
"calva.jackIn"
(clj->js {:connectSequence {:projectType "deps.edn"
:projectRootPath ["."]}}))
```
--------------------------------
### Install npm Dependencies
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/luminus.md
After creating the project, install the necessary npm dependencies using either npm or yarn.
```sh
$ npm i
```
--------------------------------
### Serve Calva Documentation Locally
Source: https://github.com/betterthantomorrow/calva/wiki/Run-Calva-in-Development-Mode
Start the MkDocs development server to preview the Calva documentation locally. Changes will be reloaded automatically.
```shell
mkdocs serve
```
--------------------------------
### Start Basilisp nREPL Server
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/basilisp.md
Start the bundled nREPL server for Basilisp. This allows Calva to connect to a running REPL in your project.
```shell
$ basilisp nrepl-server
```
--------------------------------
### Start Development Build with REPL
Source: https://github.com/betterthantomorrow/calva/blob/published/test-data/projects/minimal-figwheel-main/README.md
Execute this command from the terminal to initiate the development build, watch for file changes, open a browser, and connect a REPL.
```bash
clojure -M -m figwheel.main -b dev -r
```
--------------------------------
### Formatted Test Code Example
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/formatting.md
This shows the result of formatting the `:test-code` from the previous example after applying the specified cljfmt rules.
```clojure
:test-code
(concat [2]
(map #(inc (* % 2))
(filter #(aget sieved %)
(range 1 hn))))
```
--------------------------------
### Install Basilisp
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/basilisp.md
Use this command to install Basilisp via pip. Ensure you are in the correct Python environment.
```shell
$ pip install basilisp
```
--------------------------------
### Create Luminus Project with shadow-cljs
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/luminus.md
Use this command to create a new Luminus project with shadow-cljs support. Ensure you have Leiningen installed.
```sh
$ lein new luminus my-luminus-shadow +reagent +re-frame +shadow-cljs
```
--------------------------------
### Keyboard Shortcut to Connect with Options
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/customizing-jack-in-and-connect.md
Example of a keyboard shortcut configuration to connect to a running REPL, bypassing any connect sequence by setting `disableAutoSelect` to true.
```json
{
"command": "calva.connect",
"args": {"disableAutoSelect": true},
"key": "ctrl+alt+c shift+c",
}
```
--------------------------------
### Configuration Priority Example for Alias Maps
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/paredit.md
Illustrates how project-specific alias maps in `.calva/config.edn` override user-level configurations in `~/.config/calva/config.edn`.
```clojure
;; ~/.config/calva/config.edn (user config)
{:aliasMap {"p" "promesa.core"}}
;; .calva/config.edn (project config) - takes precedence
{:aliasMap {"p" "my.custom.promises"}}
;; Result: "p" resolves to "my.custom.promises"
```
--------------------------------
### Configure Automatic Browser Opening
Source: https://github.com/betterthantomorrow/calva/blob/published/test-data/projects/full-stack-w-dataspex/README.md
To automatically open the application in the browser after the REPL starts, update the `afterCLJReplJackInCode` setting in `.vscode/settings.json`.
```clojure
(clojure.java.browse/browse-url "http://localhost:3000")
```
--------------------------------
### Create Luminus Project with Figwheel
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/luminus.md
Use this command to create a new Luminus project with Figwheel support. This setup is considered legacy.
```sh
$ lein new luminus my-fw +reagent
```
--------------------------------
### Bind calva.refresh Command with Arguments
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/commands.md
Example of a keyboard shortcut binding for the `calva.refresh` command, demonstrating how to pass arguments like `:after` for specific operations.
```json
{
"key": "ctrl+alt+c f1",
"command": "calva.refresh",
"args": {
"after": "component.repl/reset"
}
},
```
--------------------------------
### Create Luminus Server Only Project
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/luminus.md
Use this command to create a new Luminus project for server-only development. This is a default setup.
```sh
$ lein new luminus my-luminus-server
```
--------------------------------
### Custom REPL Command to Start Reveal Tapper
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/reveal.md
Define a custom REPL command in Calva's settings to easily start the Reveal UI and tap into evaluations.
```json
"calva.customREPLCommandSnippets": [
...
{
"name": "Start Reveal Tapper",
"snippet": "(require '[vlaaad.reveal :as reveal])(add-tap (reveal/ui))",
"key": "sr"
},
...
]
```
--------------------------------
### Running All Unit Tests
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/grammar/README.md
Execute all unit tests, including the Clojure grammar tests. This command requires npm to be installed and configured.
```bash
npm run unit-test
```
--------------------------------
### Keyboard Shortcut for Calva Jack-in
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/customizing-jack-in-and-connect.md
Example of a keyboard shortcut configuration to bypass connect sequences and force Calva to prompt for jack-in menus.
```json
{
"command": "calva.jackIn",
"args": {"disableAutoSelect": true},
"key": "ctrl+alt+c shift+j",
},
```
--------------------------------
### Multi-Connection Scenario Graph
Source: https://github.com/betterthantomorrow/calva/blob/published/dev/docs/multi-session-architecture.md
Visualizes a multi-connection setup with different clients (nREPL) and their associated sessions (Clojure, ClojureScript, Babashka), including file routing.
```mermaid
graph TB
subgraph "Connection 1 (deps.edn + shadow-cljs)"
C1[Client: nrepl-client-1
port: 51234]
S1A[Session: clj]
S1B[Session: cljs]
C1 --> S1A
C1 --> S1B
end
subgraph "Connection 2 (Babashka)"
C2[Client: nrepl-client-2
port: 51235]
S2A[Session: bb]
C2 --> S2A
end
subgraph "File Routing"
F1[src/app.clj] --> S1A
F2[src/app.cljs] --> S1B
F3[scripts/build.bb] --> S2A
F4[src/shared.cljc] -->|cljc-within-connection| S1A
end
```
--------------------------------
### Configure Custom Jack-in Command Line with Arguments
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/connect-sequences.md
Example of how to specify a custom jack-in command line in Calva settings, passing arguments to a Babashka script.
```json
"customJackInCommandLine": "../../custom-jack-in.bb --aliases JACK-IN-CLJS-LAUNCH-BUILDS --cider-nrepl-version JACK-IN-CIDER-NREPL-VERSION",
```
--------------------------------
### ClojureDocs Example in Rich Comment
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/clojuredocs.md
This snippet shows how a ClojureDocs example is presented in Calva's Rich Comment block after being fetched from clojuredocs.org. It includes the original function, the example code, and 'See also' references.
```clojure
(defn trim-text
"Returns text without surrounding whitespace if not empty, otherwise nil"
[text]
(let [trimmed-text (clojure.string/trim text)]
(when-not (empty? trimmed-text)
trimmed-text)))
(comment
;; = when-not - Example 1 =
;; build tuples over sets with the same cardinality
(map
#(when-not (= %2 %3) [%1 %2 %3])
(iterate inc 0) ; a lazy list of indices
[:a :b :c]
[:a :a :a])
;;=> (nil [1 :b :a] [2 :c :a])
;; See also:
when
when-let
if
)
```
--------------------------------
### Jack-in Command Line Example
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/debugger.md
This command line is used for connecting to a REPL with the necessary Calva dependencies and middleware loaded. Ensure `cider/cider-nrepl` is a dependency and `cider.nrepl/cider-middleware` is included in the middleware list.
```sh
clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"0.8.3"},cider/cider-nrepl {:mvn/version,"0.25.8"}}}' -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
```
--------------------------------
### Open Project in VS Code
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/luminus.md
Navigate to the created project directory and open it in VS Code to begin development.
```sh
$ code my-luminus-shadow
```
--------------------------------
### Example of Test Failure Report
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/grammar/things-to-consider.md
This is an example of a test failure report, showing the seed, path, and counterexample that led to the error. It indicates a failure in property-based testing.
```clojure
Error: Property failed after 58 tests
{ seed: -1913189269, path: "57:0:0:0:0:0:0:0:0:0:0:2:1:1:1:1:1:1:1:1:1:1:1:1:1:1:2:9:8:8:8:8:8:8:8:0:0:0:0:0:0", endOnFailure: true }
Counterexample: ["##~"]
Shrunk 40 time(s)
Got error: AssertionError: expected 'junk' to equal 'id'
```
--------------------------------
### Example of Aliased Form Working with Configuration
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/paredit.md
Demonstrates how an aliased form like `p/let` works correctly after configuring custom pair forms and alias mappings, enabling Paredit's structural editing commands.
```clojure
(p/let [result (http/get "/api/data")
parsed (json/parse result)]
;; Paredit now understands this is a binding form!
;; You can:
;; - Select binding pairs as units
;; - Drag pairs with alt+up/down
;; - Navigate with structural commands
parsed)
```
--------------------------------
### cljfmt Configuration with Test Code
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/formatting.md
This example demonstrates how to include test code within your cljfmt configuration to experiment with formatting rules. The `:test-code` key is ignored by cljfmt but useful for live testing.
```clojure
{
:remove-surrounding-whitespace? true
:remove-trailing-whitespace? true
:remove-consecutive-blank-lines? false
:insert-missing-whitespace? false
:indent-line-comments? true
:indents {#re "^\w" [[:inner 0]]}
:test-code
(concat [2]
(map #(inc (* % 2))
(filter #(aget sieved %)
(range 1 hn))))
}
```
--------------------------------
### Install Clojure CLI and lein in Dockerfile
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/remote-development.md
Modify your Dockerfile to install the Clojure CLI and optionally leiningen. This ensures the necessary tools are available within your development container.
```Dockerfile
# ...
# Install Clojure - see https://github.com/Quantisan/docker-clojure/blob/master/target/openjdk-14-slim-buster/tools-deps/Dockerfile
ENV CLOJURE_VERSION=1.10.1.619
WORKDIR /tmp
RUN \
apt-get update && \
apt-get install -y curl make rlwrap wget && \
rm -rf /var/lib/apt/lists/* && \
wget https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \
sha256sum linux-install-$CLOJURE_VERSION.sh && \
echo "28b1652686426cdf856f83551b8ca01ff949b03bc9a533d270204d6511a8ca9d *linux-install-$CLOJURE_VERSION.sh" | sha256sum -c - && \
chmod +x linux-install-$CLOJURE_VERSION.sh && \
./linux-install-$CLOJURE_VERSION.sh
RUN \
su vscode -c "(clojure-version)" && \
rm ./linux-install-$CLOJURE_VERSION.sh
# Install Lein
RUN \
wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein -O /bin/lein && \
chmod uog+x /bin/lein
RUN su vscode -c "/bin/lein"
# Cleanup
RUN apt-get purge -y --auto-remove curl wget
# ...
```
--------------------------------
### Install React Native Inspector Globally
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/krell.md
Install the React Native inspector globally using yarn. This command is necessary if you need to use the React Native element inspector.
```sh
yarn global add react-devtools
```
--------------------------------
### Install Clojure Warrior Development Version Locally
Source: https://github.com/betterthantomorrow/calva/blob/published/src/highlight/README.md
This command creates a symbolic link to install the development version of Clojure Warrior locally within your VS Code extensions directory.
```bash
ln -s `pwd` ~/.vscode/extensions/tonsky.clojure-warrior-0.2.0
```
--------------------------------
### Joyride Command to Connect to REPL
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/customizing-jack-in-and-connect.md
A Joyride script example for connecting to a REPL on a specific port and using a generic connect sequence, without prompting for project type.
```clojure
(vscode/commands.executeCommand "calva.connect" (clj->js {:port "55555" :connectSequence "Generic"}))
```
--------------------------------
### Calva: Evaluate From Start of List to Cursor, Closing Brackets
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/eval-tips.md
Evaluates code from the start of the current enclosing list to the cursor position, automatically adding the necessary closing bracket. Ideal for inspecting intermediate results in pipelines like thread or doto forms.
```clojure
(->> [1 1 2 3 5 8 13 21]
(partition 2)
(zipmap [:a :b :c :d])
:d| ; => (13 21)
(apply -)
(Math/abs))
```
--------------------------------
### Clojure Function Definition
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/clojuredocs.md
This is an example Clojure function definition used to demonstrate ClojureDocs integration.
```clojure
(defn trim-text
"Returns text without surrounding whitespace if not empty, otherwise nil"
[text]
(let [trimmed-text (clojure.string/trim text)]
(when-not (empty? trimmed-text)
trimmed-text)))
```
--------------------------------
### Run Project Tests with Gradle
Source: https://github.com/betterthantomorrow/calva/blob/published/test-data/projects/my-gradle/README.md
Execute the project's tests using the Gradle wrapper. Note that tests may fail until they are edited.
```bash
./gradlew test
```
--------------------------------
### String Interpolation Example
Source: https://github.com/betterthantomorrow/calva/wiki/Coding-Style
Prefer template literals for string interpolation over concatenation. Only use interpolation when actually interpolating expressions.
```javascript
const message = `Hello, ${name}!`;
```
--------------------------------
### Configure shadow-cljs Frontend Build
Source: https://github.com/betterthantomorrow/calva/blob/published/test-data/projects/full-stack-w-dataspex/README.md
Configuration for the frontend build in `shadow-cljs.edn`, including settings for devtools, hot reloading, and output directories.
```clojure
:frontend
{
:devtools
{:after-load clj-reload.core/reload!}
:output-dir "public/cljs-out"
:asset-path "/cljs-out"
:modules {:main {:init-fn acme.frontend.app/init!}}
:preloads [devtools.preload]
}
```
--------------------------------
### Reveal Dependency Only Alias (tools.deps)
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/reveal.md
Configure a deps.edn alias to only include the Reveal dependency. This allows you to start Reveal manually.
```clojure
:reveal-dep-only
{:extra-deps {vlaaad/reveal {:mvn/version ""}}}
```
--------------------------------
### deps.edn Configuration for REBL
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/rebl.md
Add these aliases to your deps.edn file for REBL integration. Adjust the local path for REBL.jar to match your installation.
```clojure
;; REBL Base
:rebl
{:extra-deps {org.clojure/core.async {:mvn/version "0.4.490"}
;; deps for file datafication (0.9.149 or later)
org.clojure/data.csv {:mvn/version "0.1.4"}
org.clojure/data.json {:mvn/version "0.2.3"}
org.yaml/snakeyaml {:mvn/version "1.23"}
com.cognitect/rebl
;; adjust to match your install location
{:local/root "/Users/ozimos/REBL/latest/REBL.jar"}}}
;; REBL 12
:rebl-12
{:extra-deps {org.openjfx/javafx-fxml {:mvn/version "12.0.1"}
org.openjfx/javafx-controls {:mvn/version "12.0.1"}
org.openjfx/javafx-graphics {:mvn/version "12.0.1"}
org.openjfx/javafx-media {:mvn/version "12.0.1"}
org.openjfx/javafx-swing {:mvn/version "12.0.1"}
org.openjfx/javafx-base {:mvn/version "12.0.1"}
org.openjfx/javafx-web {:mvn/version "12.0.1"}}}
;; nREBL
:nrebl {:extra-deps {rickmoynihan/nrebl.middleware {:mvn/version "0.2.0"}}
:main-opts ["-e" "((requiring-resolve,'cognitect.rebl/ui))" "-m" "nrepl.cmdline" "--middleware" "[nrebl.middleware/wrap-nrebl]" "-I"]}
```
--------------------------------
### Configure `.vsls.json` for `.calva` Folder Visibility
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/live-share.md
Use this configuration in a `.vsls.json` file to ensure the `.calva` folder is visible to guests in Live Share sessions. This is necessary for Calva's `output.calva-repl` file to be accessible.
```json
{
"$schema": "http://json.schemastore.org/vsls",
"hideFiles": [
"!.calva"
]
}
```
--------------------------------
### calva.selectReplWindowSession
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/commands.md
Selects a REPL window session. If a session key is provided, it sets the REPL window to use that specific session. If no argument is given, a picker interface is presented to the user.
```APIDOC
## calva.selectReplWindowSession
### Description
Select REPL Window Session.
### Arguments
`sessionKey?: string`
Sets the REPL window to use the specified session. If no argument is provided, shows a picker.
### Returns
Returns `void`.
```
--------------------------------
### Access Calva API in JavaScript
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/api.md
Access the Calva API from a JavaScript extension. This involves getting the extension instance and accessing its exports.
```javascript
const calvaExt = vscode.extensions.getExtension("betterthantomorrow.calva");
const calva = calvaExt.exports.v1;
const sessionKey = calva.repl.currentSessionKey()
```
--------------------------------
### Access Calva API in ClojureScript
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/api.md
Access the Calva API from a ClojureScript extension. This involves getting the extension instance and accessing its exports.
```clojurescript
(def calvaExt (vscode/extensions.getExtension "betterthantomorrow.calva"))
(def calva (-> calvaExt
.-exports
.-v1
(js->clj :keywordize-keys true)))
((get-in calva [:repl :currentSessionKey])) => "cljs" ; or "clj", depending
```
--------------------------------
### Skeleton Babashka Script for Custom Jack-in
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/connect-sequences.md
A sample Babashka script demonstrating argument parsing and processing, intended as a starting point for custom REPL connection scripts.
```clojure
#!/usr/bin/env bb
(require '[clojure.string :as str])
(defn parse-args [args]
(loop [args args
parsed {}]
(if (empty? args)
parsed
(let [[flag value & rest-args] args]
(case flag
"--aliases" (recur rest-args (assoc parsed :aliases value))
"--cider-nrepl-version" (recur rest-args (assoc parsed :cider-nrepl-version value))
(do (println "Unknown parameter:" flag) (System/exit 1)))))))
(defn process-args [args]
(let [aliases (str/split (:aliases args) #",")
cider-nrepl-version (:cider-nrepl-version args)
project-root-path (System/getenv "JACK_IN_PROJECT_ROOT_PATH")]
(println "Aliases:")
(doseq [alias aliases]
(println alias))
(println "CIDER nREPL version:" cider-nrepl-version)
(println "JACK_IN_PROJECT_ROOT_PATH:" project-root-path)))
(def parsed-args (parse-args *command-line-args*))
(when (= *file* (System/getProperty "babashka.file"))
(process-args parsed-args))
```
--------------------------------
### Connection State Functions
Source: https://github.com/betterthantomorrow/calva/blob/published/dev/docs/multi-session-architecture.md
Functions for managing per-connection state, specifically for CLJS-related information. Use these to get or set connection-specific details.
```typescript
getConnectionState(clientKey)
```
```typescript
setConnectionState(clientKey, state)
```
--------------------------------
### Custom Keybindings for Revealing Output
Source: https://github.com/betterthantomorrow/calva/blob/published/docs/site/output.md
Example of registering custom keybindings for Calva commands to reveal output destinations. The 'args' property controls whether the command preserves focus.
```json
{
"key": "ctrl+alt+o ctrl+alt+o",
"command": "calva.showResultOutputDestination",
"args": false
},
{
"key": "ctrl+alt+o ctrl+alt+r",
"command": "calva.showReplWindow",
"args": true
}
```