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: eval-tips/index.html
+42-1
Original file line number
Diff line number
Diff line change
@@ -2294,16 +2294,57 @@ <h2 id="evaluation-in-a-file-editor">Evaluation in a File Editor<a class="header
2294
2294
<p>Calva has many commands for evaluating forms, including the <strong>current form</strong> and the <strong>current top-level form</strong>.</p>
2295
2295
<p>Some of the commands also let you choose what should happen with the results:</p>
2296
2296
<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>
2298
2298
<li>This also creates a hover pane including the full results and a button which will copy the results to the clipboard.</li>
2299
2299
<li>There is also a command for copying the last result to the clipboard.</li>
2300
2300
<li>The full results are always available in the <ahref="../output/">output destination</a>.<ul>
2301
2301
<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>
2302
2302
</ul>
2303
2303
</li>
2304
+
</ul>
2305
+
</li>
2304
2306
<li><strong>To comments.</strong> This will add the results as line comments below the current line.</li>
2305
2307
<li><strong>Replace the evaluated code.</strong> This will do what it says, the evaluated code will be replaced with its results.</li>
2306
2308
</ol>
2309
+
<detailsclass="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>
Copy file name to clipboardExpand all lines: evaluation/index.html
+42-1
Original file line number
Diff line number
Diff line change
@@ -2294,16 +2294,57 @@ <h2 id="evaluation-in-a-file-editor">Evaluation in a File Editor<a class="header
2294
2294
<p>Calva has many commands for evaluating forms, including the <strong>current form</strong> and the <strong>current top-level form</strong>.</p>
2295
2295
<p>Some of the commands also let you choose what should happen with the results:</p>
2296
2296
<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>
2298
2298
<li>This also creates a hover pane including the full results and a button which will copy the results to the clipboard.</li>
2299
2299
<li>There is also a command for copying the last result to the clipboard.</li>
2300
2300
<li>The full results are always available in the <ahref="../output/">output destination</a>.<ul>
2301
2301
<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>
2302
2302
</ul>
2303
2303
</li>
2304
+
</ul>
2305
+
</li>
2304
2306
<li><strong>To comments.</strong> This will add the results as line comments below the current line.</li>
2305
2307
<li><strong>Replace the evaluated code.</strong> This will do what it says, the evaluated code will be replaced with its results.</li>
2306
2308
</ol>
2309
+
<detailsclass="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>
0 commit comments