You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,33 @@ Changes to Calva.
7
7
-[Add Paredit Kill Left equivalent to Kill Right](https://github.com/BetterThanTomorrow/calva/issues/2426)
8
8
- Fix: Certain `paredit.killRight` edges cases on Windows.
9
9
10
+
## [2.0.424] - 2024-03-17
11
+
12
+
-[Add command for revealing the **Calva says** output channel](https://github.com/BetterThanTomorrow/calva/issues/2436)
13
+
- Fix: [Results not shown inline when output-channel configured is configured as for results output](https://github.com/BetterThanTomorrow/calva/issues/2437)
14
+
-[Make the results hover aware of where the results output goes](https://github.com/BetterThanTomorrow/calva/issues/2438)
-[Try to find namespace for notebook eval.](https://github.com/BetterThanTomorrow/calva/issues/2408)
24
+
25
+
## [2.0.421] - 2024-03-11
26
+
27
+
- Fix: [Slowness printing compiler errors and warnings to Output Window](https://github.com/BetterThanTomorrow/calva/issues/2291)
28
+
29
+
## [2.0.420] - 2024-03-10
30
+
31
+
-[Allow to use an array of strings for `afterCLJReplJackInCode` in a connect sequence](https://github.com/BetterThanTomorrow/calva/issues/2423)
32
+
33
+
## [2.0.419] - 2024-03-08
34
+
35
+
-[Automatically do Rename Symbol after refactors that add new names](https://github.com/BetterThanTomorrow/calva/issues/2388)
36
+
10
37
## [2.0.418] - 2024-03-08
11
38
12
39
-[Add selection to experimentally supported multicursor paredit commands](https://github.com/BetterThanTomorrow/calva/issues/2421). Enable `calva.paredit.multicursor` in your settings to try it out. Addressing [#610](https://github.com/BetterThanTomorrow/calva/issues/610)
Copy file name to clipboardExpand all lines: docs/site/connect-sequences.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ A connect sequence configures the following:
24
24
*`autoSelectForConnect`: A boolean. If true, this sequence will be automatically selected at **Connect**, suppressing the Project Type menu. Use together with `projectRootPath` to also suppress the Project Root menu. If you have more than one sequence with `autoSelectForConnect` set to true, the first one will be used.
25
25
*`projectRootPath`: An array of path segments leading to the root of the project to which this connect sequence corresponds. Use together with `autoSelectForJackIn`/`autoSelectForConnect` to suppress the Project Root menu. The path can be absolute or relative to the workspace root. If there are several Workspace Folders, the workspace root is the path of the first folder, so relative paths will only work for this first folder.
26
26
*`nReplPortFile`: An array of path segments with the project root-relative path to the nREPL port file for this connect sequence. E.g. For shadow-cljs this would be `[".shadow-cljs", "nrepl.port"]`.
27
-
*`afterCLJReplJackInCode`: Here you can give Calva some Clojure code to evaluate in the CLJ REPL, once it has been created.
27
+
*`afterCLJReplJackInCode`: Code to evaluate in the CLJ REPL once it has been created. You can use either a string or an array of strings. If you use an array, the strings will be joined with a newline character to form the resulting code.
28
28
*`customJackInCommandLine`: A string with a command line that should be used to launch the REPL. See [Custom Command Line](#custom-command-line), below.
29
29
*`cljsType`: This can be either "Figwheel Main", "shadow-cljs", "ClojureScript built-in for browser", "ClojureScript built-in for node", "lein-figwheel", "none", or a dictionary configuring a custom type. If set to "none", Calva will skip connecting a ClojureScript repl. A custom type has the following fields:
30
30
*`dependsOn`: (required) Calva will use this to determine which dependencies it will add when starting the project (Jacking in). This can be either "Figwheel Main", "shadow-cljs", "ClojureScript built-in for browser", "ClojureScript built-in for node", "lein-figwheel", or ”User provided”. If it is "User provided", then you need to provide the dependencies in the project or launch with an alias (deps.edn), profile (Leiningen), or build (shadow-cljs) that provides the dependencies needed.
description: When Calva evaluates Clojure/ClojureScript code, the results are displayed inline as well as printed to the results output window.
2
+
title: Evaluation results and outher output
3
+
description: Calva displays the first line of the evaluation results inline, and also prints results, other REPL output and more to the configured Output Destination.
4
4
---
5
5
6
-
# The Output/REPL Window/File
6
+
# Output Destinations
7
7
8
-
When Calva evaluates Clojure/ClojureScript code, the results are displayed inline as well as printed to the results output window/file. This file is created and opened when Calva is connected to a REPL.
8
+
Calva categorizes output into three types:
9
9
10
-
In ClojureScript projects the window will be associated with the `cljs` REPL once this one is connected. It will then look something like so:
10
+
***evaluation results**: Clojure data returned from an evaluation.
11
+
***evaluation output**: stdout/stderr from an evaluation
With the setting `calva.outputDestinations`, you can configure where each category of output should go to:
13
15
14
-
The first prompt is from when the `clj` REPL is connected, the second when Calva has a `cljs` REPL connection. The first part of the prompt tells you which REPL type the window is currently connected to. This gets important when the file/window is used as an interactive REPL.
15
-
16
-
## Find the Output/REPL Window
17
-
18
-
If you quickly want to open and switch to the output window there is the command **Calva: Show Output Window**, `ctrl+alt+o o`.
19
-
20
-
To sync the Output/REPL window namespace with the current file before switching, use the **Switch Namespace of the Output/REPL Window to Current Namespace** command, `ctrl+alt+c alt+n`.
21
-
22
-
## Find the File for the Current REPL Window Namespace
23
-
24
-
When you are working from the Output/REPL window, and want to open the file that defines its current namespace, use the **Show File for the Current Output/REPL Window Namespace** command, `ctrl+alt+o o`.
25
-
26
-
!!! Note
27
-
This also works for Clojure core and library namespaces.
28
-
29
-
## Evaluating Code
30
-
31
-
The window will be automatically associated with the REPL and the namespace of any project Clojure/ClojureScript file you evaluate code in. So for instance if you evaluate this code in a `clj` file with the namespace `fresh-reagent.handler`:
32
-
33
-
```clojure
34
-
(defmount-target
35
-
[:div#app
36
-
[:h2"Welcome to fresh-reagent"]
37
-
[:p"please wait while Figwheel is waking up ..."]
38
-
[:p"(Check the js console for hints if nothing exciting happens.)"]])
39
-
```
40
-
41
-
The output window will print the defined var and then a new prompt reflecting the current REPL connection and namespace:
This, since the namespace ”followed” the first evaluation over to the output window.
56
-
57
-
## REPL History
58
-
59
-
Recently evaluated forms in the REPL file are persisted and can easily be shown again for modifying and re-evaluating.
60
-
61
-
### Navigate REPL History
62
-
63
-
You can navigate up and down the last forms evaluated in the REPL file by using `alt+up` and `alt+down`, provided your cursor is at the end of the last form after the prompt. If the cursor is not at the end of the last form, then `alt+up` and `alt+down` will do what they are mapped to, which is by default "Move Line Up" and "Move Line Down," respectively.
64
-
65
-
If you have typed some text after the prompt before you start traversing up the history, this text will be preserved and will display when you traverse back down the history. If you modify some text in the history while traversing, the modification will be saved at that location in history.
66
-
67
-
### Clear REPL History
68
-
69
-
You can clear the repl history by running the command "Clear REPL History" from the command palette.
70
-
71
-
## Stack Traces
72
-
73
-
When an evaluation produces an error, the output window will automatically print the the error message. If there is a stack trace associated with the error, this can now be printed on demand using the **Calva: Print Last Stacktrace to the Output Window** command. The output window will also have a Codelense button below the error message that will print the stack trace..
For printed stacktraces, when source locations are available (Clojure files) you will be able to navigate to them by pressing `ctrl+click` (`cmd+click` on Mac) on the file name. You can also hover over symbols in the stack trace to see the symbol's documentation, and `ctrl+click` (`cmd+click` on Mac) the symbol to Peek Definition.
78
-
79
-

80
-
81
-
## Load Current Namespace
82
-
83
-
When navigating namespaces it is easy to [forget to first require them](https://clojure.org/guides/repl/navigating_namespaces#_how_things_can_go_wrong) and that can be a bit tricky to fix. To help with this Calva's command **Load/Evaluate Current File and its Requires/Dependencies** also works in the output window, but then acts like **Load Current Namespace**.
84
-
85
-
Consider you have two files, `pez/xxx.clj` and `pez/yyy.clj`, where `pez.yyy` requires `pez.xxx`.
86
-
87
-
```clojure
88
-
(nspez.xxx)
89
-
90
-
(defa:xxx-a)
91
-
92
-
(defb:xxx-b)
93
-
```
94
-
95
-
```clojure
96
-
(nspez.yyy
97
-
(:require [pez.xxx]))
98
-
99
-
(defa:yyy-a)
100
-
101
-
(println"Hello" pez.xxx/a)
102
-
```
103
-
104
-
Then with a freshly jacked-in REPL you do `(ns pez.yyy)` and want to work with the vars defined there. Clojure will complain. But if you **Load/Evaluate Current File and its Requires/Dependencies**, it will start working. Something like so:
105
-
106
-

107
-
108
-
!!! Note
109
-
This currently suffers from a limitation in Calva where it won't reload dependencies, so you will sometimes have to do this ”manually” anyway (by opening the files and loading them). See [Calva issue #907](https://github.com/BetterThanTomorrow/calva/issues/907)
110
-
111
-
### Peek Current Namespace
112
-
113
-
A somewhat hidden feature: You can see documentation for, peek and navigate to a namespace by hovering on the namespace symbol in one of the repl window prompts (just like you would if it was not in the prompt 😄).
114
-
115
-
## Paredit Enabled
116
-
117
-
The output window is mostly a regular Calva Clojure/ClojureScript file, which make everything that works in a regular file work in this file, including [Paredit](paredit.md). This makes it easy to navigate the input and output. For instance, to select the last evaluation results you can press `ctrl+w` (`shift+alt+right` on Windows and Linux):
118
-
119
-

120
-
121
-
## Debugger Enabled
122
-
123
-
The output window is mostly a regular... (you get it), which means you also have the [Calva debugger](debugger.md) at your command at the REPL prompt (only for `clj` sessions, so far). So instead of evaluating a function definition using `alt+enter` you can evaluate it and instrument it for debugging using `ctrl+alt+c i`. Then call the function.
The contents of the output/REPL window is written to a file named `output.repl` in the `.calva/output-window` directory of your project. The file is recreated at every new session. And you should copy anything you want to keep from this file to wherever you want to keep it.
130
-
131
-
You probably want to add `.calva/output-window/` to your `.<something>ignore` files. (There are some more files in that directory that you shouldn't keep under source control.)
132
-
133
-
## Choose CLJ or CLJS REPL Connection
134
-
135
-
In full stack projects, you will probably use the window as a REPL for both `clj` and `cljs`. You can toggle which REPL the window is connected to using the command **Calva: Toggle REPL Connection for CLJC files**. There is a button for this in the status bar:
@@ -146,10 +26,9 @@ When Calva is connected to the REPL, the Output window will by default print not
146
26
147
27
You can control the default via the `calva.redirectServerOutputToRepl` setting. It defaults to `true`. Setting it to `false` before connecting the REPL will result in that **2.** and **3.** will not get printed in the Output window. It will then instead be printed wherever the REPL process is printing its messages, usually the terminal from where it was started (the **Jack-in terminal** if Calva started the REPL).
148
28
149
-
The main reason for keeping the default is that all output from an evaluation is kept together, instead of some of it in the Output window and some of it in the REPL process terminal. It comes with the side effect that all REPL process output will also be printed in the Output window. There is currently no way to separate these. If you are working mostly in ClojureScript, you might want to disable `calva.redirectServerOutputToRepl`, since there are no child threads there anyway.
150
-
151
-
## Known Quirks
29
+
## Commands for showing output destinations
152
30
153
-
Due to limitations in the VS Code API it is hard for Calva to know if the output file is opened, and also if it is opened more than once. Make it a habit to leave this window opened. And if it is opened in several tabs, expect evaluation printouts to be a bit unpredictable.
31
+
These are the commands and their default keyboard shortcuts for revealing output destinations
154
32
155
-
If you save the output/REPL file (which most often does not make much sense, but anyway) you will sometimes be presented with a message about VS Code being confused about the file contents being out of sync. Just choose to *Overwrite* the currently saved version and you should be fine.
33
+
***Calva: Show/Open the result output destination** - `ctrl+alt+o ctrl+o`
34
+
***Calva: Show/Open the Calva says Output Channel** - `ctrl+alt+o o`
Copy file name to clipboardExpand all lines: docs/site/paredit.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ To make the command descriptions a bit clearer, each entry is animated. When you
48
48
49
49
### Strings are not Lists, but Anyway...
50
50
51
-
In Calva Paredit, strings are treated in much the same way as lists are. Here's an example showing **Slurp** and **Barf**, **Forward/Backward List**, and **Grow Selection**.
51
+
In Calva Paredit, strings are treated in much the same way as lists are. Here's an example showing **Slurp** and **Barf**, **Forward/Backward List**, and **Expand Selection**.
52
52
53
53

54
54
@@ -76,7 +76,7 @@ Most of these commands are selecting ”versions” of the navigation commands a
76
76
Default keybinding | Action | Description
77
77
------------------ | ------ | -----------
78
78
`shift+alt+right` (win/linux)<br>`ctrl+w` (mac) | **Expand Selection** | Starts from the cursor and selects the current form. Then will keep expanding to enclosing forms.<br> 
79
-
`shift+alt+left` (win/linux)<br>`ctrl+shift+w` (mac) | **Shrink Selection** | Contracts back from an expanded selection performed by any Paredit selection command.<br> <br>(In the animation the selection is first grown using a combination of **Grow Selection** and some lateral selection commands, then shrunk all the way back down to no selection.)
79
+
`shift+alt+left` (win/linux)<br>`ctrl+shift+w` (mac) | **Shrink Selection** | Contracts back from an expanded selection performed by any Paredit selection command.<br> <br>(In the animation the selection is first grown using a combination of **Expand Selection** and some lateral selection commands, then shrunk all the way back down to no selection.)
80
80
`ctrl+alt+w space` | **Select Top Level Form** | Top level in a structural sense. Typically where your`(def ...)`/`(defn ...)` type forms. Please note that`(comment ...)` forms create a new top level. <br> 
`ctrl+shift+k` | **Select Right** | Select forward to the end of the current form or the first newline. See **Kill right** below. (The animation also shows **Shrink Selection**).<br> 
0 commit comments