Skip to content

Commit 7ae5a21

Browse files
author
committed
[skip ci]
1 parent 14c9c4a commit 7ae5a21

File tree

5 files changed

+148
-66
lines changed

5 files changed

+148
-66
lines changed

eval-tips/index.html

+42-1
Original file line numberDiff line numberDiff line change
@@ -2294,16 +2294,57 @@ <h2 id="evaluation-in-a-file-editor">Evaluation in a File Editor<a class="header
22942294
<p>Calva has many commands for evaluating forms, including the <strong>current form</strong> and the <strong>current top-level form</strong>.</p>
22952295
<p>Some of the commands also let you choose what should happen with the results:</p>
22962296
<ol>
2297-
<li><strong>Inline.</strong> This will display the results (or some of it, if it is long) inline in the editor.</li>
2297+
<li><strong>Inline.</strong> This will display the results (or some of it, if it is long) inline in the editor.<ul>
22982298
<li>This also creates a hover pane including the full results and a button which will copy the results to the clipboard.</li>
22992299
<li>There is also a command for copying the last result to the clipboard.</li>
23002300
<li>The full results are always available in the <a href="../output/">output destination</a>.<ul>
23012301
<li>There is a command for showing the output destination, allowing for a workflow where you either generally have it closed, or have it as one of the tabs in the same editor group as the files you are working with.</li>
23022302
</ul>
23032303
</li>
2304+
</ul>
2305+
</li>
23042306
<li><strong>To comments.</strong> This will add the results as line comments below the current line.</li>
23052307
<li><strong>Replace the evaluated code.</strong> This will do what it says, the evaluated code will be replaced with its results.</li>
23062308
</ol>
2309+
<details class="note">
2310+
<summary>Evaluate to comments support different comment styles</summary>
2311+
<p>When using the commands for evaluating to comments, <strong>Evaluate Top Level Form (defun) to Comment</strong>, and <strong>Evaluate Selection to Comment</strong>, the commands will insert the results as line comments (<code>;; ...</code>) below the evaluated form. However, there are two additional comment styles available. To use these you need to execute the commands via VS Code API, typically from keybindings. The commands take an argument map with the key <code>commentStyle</code>. You can choose between three different comment styles: <code>line</code>, <code>ignore</code>, and <code>rcf</code>:</p>
2312+
<ul>
2313+
<li>The default is <code>line</code>.</li>
2314+
<li>The <code>line</code> style is the default.</li>
2315+
<li>The <code>ignore</code> style will put an ignore marker (<code>#_</code>) before the result.</li>
2316+
<li>The <code>rcf</code> style will wrap the result in a rich comment form ( <code>(comment ...)</code>).</li>
2317+
</ul>
2318+
<p>Here are some example keybindings for using the different comment styles with the <strong>Evaluate Top Level Form (defun) to Comment</strong> command:</p>
2319+
<div class="highlight"><pre><span></span><code>{
2320+
&quot;key&quot;: &quot;ctrl+alt+c ctrl+space&quot;,
2321+
&quot;command&quot;: &quot;calva.evaluateTopLevelFormAsComment&quot;,
2322+
&quot;when&quot;: &quot;editorTextFocus &amp;&amp; editorLangId == &#39;clojure&#39;&quot;,
2323+
&quot;args&quot;: {
2324+
&quot;commentStyle&quot;: &quot;line&quot;
2325+
}
2326+
},
2327+
{
2328+
&quot;key&quot;: &quot;ctrl+alt+c ctrl+i&quot;,
2329+
&quot;command&quot;: &quot;calva.evaluateTopLevelFormAsComment&quot;,
2330+
// &quot;command&quot;: &quot;calva.evaluateSelectionAsComment&quot;,
2331+
&quot;when&quot;: &quot;editorTextFocus &amp;&amp; editorLangId == &#39;clojure&#39;&quot;,
2332+
&quot;args&quot;: {
2333+
&quot;commentStyle&quot;: &quot;ignore&quot;
2334+
}
2335+
},
2336+
{
2337+
&quot;key&quot;: &quot;ctrl+alt+c ctrl+r&quot;,
2338+
&quot;command&quot;: &quot;calva.evaluateTopLevelFormAsComment&quot;,
2339+
// &quot;command&quot;: &quot;calva.evaluateSelectionAsComment&quot;,
2340+
&quot;when&quot;: &quot;editorTextFocus &amp;&amp; editorLangId == &#39;clojure&#39;&quot;,
2341+
&quot;args&quot;: {
2342+
&quot;commentStyle&quot;: &quot;rcf&quot;
2343+
}
2344+
},
2345+
</code></pre></div>
2346+
<p>The first keybinding there is the default for the command, and only included as an example.</p>
2347+
</details>
23072348
<h2 id="wait-current-form-top-level-form">Wait, Current Form? Top-level Form?<a class="headerlink" href="#wait-current-form-top-level-form" title="Permanent link">#</a></h2>
23082349
<p>These are important concepts in Calva in order for you to create your most effective workflow. This video explains it a bit:</p>
23092350
<iframe width="560" height="315" src="https://www.youtube.com/embed/8ygw7LLLU1w" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

evaluation/index.html

+42-1
Original file line numberDiff line numberDiff line change
@@ -2294,16 +2294,57 @@ <h2 id="evaluation-in-a-file-editor">Evaluation in a File Editor<a class="header
22942294
<p>Calva has many commands for evaluating forms, including the <strong>current form</strong> and the <strong>current top-level form</strong>.</p>
22952295
<p>Some of the commands also let you choose what should happen with the results:</p>
22962296
<ol>
2297-
<li><strong>Inline.</strong> This will display the results (or some of it, if it is long) inline in the editor.</li>
2297+
<li><strong>Inline.</strong> This will display the results (or some of it, if it is long) inline in the editor.<ul>
22982298
<li>This also creates a hover pane including the full results and a button which will copy the results to the clipboard.</li>
22992299
<li>There is also a command for copying the last result to the clipboard.</li>
23002300
<li>The full results are always available in the <a href="../output/">output destination</a>.<ul>
23012301
<li>There is a command for showing the output destination, allowing for a workflow where you either generally have it closed, or have it as one of the tabs in the same editor group as the files you are working with.</li>
23022302
</ul>
23032303
</li>
2304+
</ul>
2305+
</li>
23042306
<li><strong>To comments.</strong> This will add the results as line comments below the current line.</li>
23052307
<li><strong>Replace the evaluated code.</strong> This will do what it says, the evaluated code will be replaced with its results.</li>
23062308
</ol>
2309+
<details class="note">
2310+
<summary>Evaluate to comments support different comment styles</summary>
2311+
<p>When using the commands for evaluating to comments, <strong>Evaluate Top Level Form (defun) to Comment</strong>, and <strong>Evaluate Selection to Comment</strong>, the commands will insert the results as line comments (<code>;; ...</code>) below the evaluated form. However, there are two additional comment styles available. To use these you need to execute the commands via VS Code API, typically from keybindings. The commands take an argument map with the key <code>commentStyle</code>. You can choose between three different comment styles: <code>line</code>, <code>ignore</code>, and <code>rcf</code>:</p>
2312+
<ul>
2313+
<li>The default is <code>line</code>.</li>
2314+
<li>The <code>line</code> style is the default.</li>
2315+
<li>The <code>ignore</code> style will put an ignore marker (<code>#_</code>) before the result.</li>
2316+
<li>The <code>rcf</code> style will wrap the result in a rich comment form ( <code>(comment ...)</code>).</li>
2317+
</ul>
2318+
<p>Here are some example keybindings for using the different comment styles with the <strong>Evaluate Top Level Form (defun) to Comment</strong> command:</p>
2319+
<div class="highlight"><pre><span></span><code>{
2320+
&quot;key&quot;: &quot;ctrl+alt+c ctrl+space&quot;,
2321+
&quot;command&quot;: &quot;calva.evaluateTopLevelFormAsComment&quot;,
2322+
&quot;when&quot;: &quot;editorTextFocus &amp;&amp; editorLangId == &#39;clojure&#39;&quot;,
2323+
&quot;args&quot;: {
2324+
&quot;commentStyle&quot;: &quot;line&quot;
2325+
}
2326+
},
2327+
{
2328+
&quot;key&quot;: &quot;ctrl+alt+c ctrl+i&quot;,
2329+
&quot;command&quot;: &quot;calva.evaluateTopLevelFormAsComment&quot;,
2330+
// &quot;command&quot;: &quot;calva.evaluateSelectionAsComment&quot;,
2331+
&quot;when&quot;: &quot;editorTextFocus &amp;&amp; editorLangId == &#39;clojure&#39;&quot;,
2332+
&quot;args&quot;: {
2333+
&quot;commentStyle&quot;: &quot;ignore&quot;
2334+
}
2335+
},
2336+
{
2337+
&quot;key&quot;: &quot;ctrl+alt+c ctrl+r&quot;,
2338+
&quot;command&quot;: &quot;calva.evaluateTopLevelFormAsComment&quot;,
2339+
// &quot;command&quot;: &quot;calva.evaluateSelectionAsComment&quot;,
2340+
&quot;when&quot;: &quot;editorTextFocus &amp;&amp; editorLangId == &#39;clojure&#39;&quot;,
2341+
&quot;args&quot;: {
2342+
&quot;commentStyle&quot;: &quot;rcf&quot;
2343+
}
2344+
},
2345+
</code></pre></div>
2346+
<p>The first keybinding there is the default for the command, and only included as an example.</p>
2347+
</details>
23072348
<h2 id="wait-current-form-top-level-form">Wait, Current Form? Top-level Form?<a class="headerlink" href="#wait-current-form-top-level-form" title="Permanent link">#</a></h2>
23082349
<p>These are important concepts in Calva in order for you to create your most effective workflow. This video explains it a bit:</p>
23092350
<iframe width="560" height="315" src="https://www.youtube.com/embed/8ygw7LLLU1w" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

search/search_index.json

+1-1
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)