Skip to content

Commit 98be64f

Browse files
committed
Merge dev
2 parents 3ec9a07 + 16c867d commit 98be64f

33 files changed

+973
-452
lines changed

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,33 @@ Changes to Calva.
77
- [Add Paredit Kill Left equivalent to Kill Right](https://github.com/BetterThanTomorrow/calva/issues/2426)
88
- Fix: Certain `paredit.killRight` edges cases on Windows.
99

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)
15+
16+
## [2.0.423] - 2024-03-17
17+
18+
- [Add Output Destinations configuration](https://github.com/BetterThanTomorrow/calva/issues/1104)
19+
20+
## [2.0.422] - 2024-03-11
21+
22+
- Bump deps.clj to `v1.11.2.1446`
23+
- [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+
1037
## [2.0.418] - 2024-03-08
1138

1239
- [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)

deps-clj-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.11.1.1435
1+
v1.11.2.1446

deps.clj.jar

26 Bytes
Binary file not shown.

docs/site/connect-sequences.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ A connect sequence configures the following:
2424
* `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.
2525
* `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.
2626
* `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.
2828
* `customJackInCommandLine`: A string with a command line that should be used to launch the REPL. See [Custom Command Line](#custom-command-line), below.
2929
* `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:
3030
* `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.

docs/site/output.md

Lines changed: 14 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -1,140 +1,20 @@
11
---
2-
title: The Output/REPL Window
3-
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.
44
---
55

6-
# The Output/REPL Window/File
6+
# Output Destinations
77

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:
99

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
12+
* **other output**: Other messages, logs, etc
1113

12-
![Output Window Connected](images/howto/output/output-window-connected.png)
14+
With the setting `calva.outputDestinations`, you can configure where each category of output should go to:
1315

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-
(def mount-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:
42-
43-
![eval-results-1](images/howto/output/eval-results-1.png)
44-
45-
If you then switch to the output window (`ctrl+alt+o o`), and enter this at the prompt:
46-
47-
```clojure
48-
mount-target
49-
```
50-
51-
then evaluate it using `alt+enter`, you'll get:
52-
53-
![eval-results-2](images/howto/output/eval-results-2.png)
54-
55-
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..
74-
75-
![Print Stacktrace Codelense button](images/howto/output/print-stacktrace-codelense.png "Print Stacktrace Codelense button")
76-
77-
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-
![Stack trace clicking and peeking definition](images/howto/output/stack-traces.gif "Stack trace clicking and peeking definition")
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-
(ns pez.xxx)
89-
90-
(def a :xxx-a)
91-
92-
(def b :xxx-b)
93-
```
94-
95-
```clojure
96-
(ns pez.yyy
97-
(:require [pez.xxx]))
98-
99-
(def a :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-
![Load Current Namespace in the Calva Output Window](images/howto/output/load-current-namespace.png)
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-
![Paredit select current form](images/howto/output/select-last-result.png)
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.
124-
125-
![repl-file debugger](images/howto/output/repl-file-debugger.png)
126-
127-
## It is Ephemeral
128-
129-
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:
136-
137-
![Toggle CLJC](images/howto/cljc-toggle-button.png)
16+
* the [REPL Window](repl-window.md)
17+
* the _Calva Says_ Output Channel.
13818

13919
## REPL process output (stdout and stderr)
14020

@@ -146,10 +26,9 @@ When Calva is connected to the REPL, the Output window will by default print not
14626

14727
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).
14828

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
15230

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
15432

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`

docs/site/paredit.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ To make the command descriptions a bit clearer, each entry is animated. When you
4848

4949
### Strings are not Lists, but Anyway...
5050

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**.
5252

5353
![](images/paredit/string-as-list.gif)
5454

@@ -76,7 +76,7 @@ Most of these commands are selecting ”versions” of the navigation commands a
7676
Default keybinding | Action | Description
7777
------------------ | ------ | -----------
7878
`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> ![](images/paredit/grow-selection.gif)
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> ![](images/paredit/shrink-selection.gif)<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> ![](images/paredit/shrink-selection.gif)<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.)
8080
`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> ![](images/paredit/select-top-level-form.gif)
8181
`shift+ctrl+right` (win/linux)<br>`shift+alt+right` (mac) | **Select Forward Sexp** | ![](images/paredit/select-forward-sexp.gif)
8282
`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> ![](images/paredit/select-right.gif)

0 commit comments

Comments
 (0)