Skip to content

Commit

Permalink
[skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
Unknown committed Jul 2, 2024
1 parent 7c4f3cd commit 280361b
Show file tree
Hide file tree
Showing 14 changed files with 90 additions and 90 deletions.
6 changes: 3 additions & 3 deletions async-out/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2002,14 +2002,14 @@


<h1 id="viewing-async-output-while-working-on-node-projects-with-shadow-cljs">Viewing Async Output While Working On Node Projects with <code>shadow-cljs</code><a class="headerlink" href="#viewing-async-output-while-working-on-node-projects-with-shadow-cljs" title="Permanent link">#</a></h1>
<p>When working on NodeJS projects with <code>shadow-cljs</code> and Calva, async output does not always appear in the Calva output window. To work around this problem, follow these steps:</p>
<p>When working on NodeJS projects with <code>shadow-cljs</code> and Calva, async output does not always appear in the Calva <a href="../output/">output destination</a>. To work around this problem, follow these steps:</p>
<ol>
<li>Run the command "Calva: Copy Jack-in Command Line to Clipboard", then paste the command in a terminal and run it.</li>
<li>Wait for the message <code>shadow-cljs - nREPL server started on port &lt;some-port&gt;</code></li>
<li>Issue the command <strong>Calva: Connect to a running REPL server in your project</strong>, <code>ctrl+alt+c ctrl+alt+c</code>. For project type select <code>shadow-cljs</code>, accept the proposed <code>localhost:&lt;some-port&gt;</code>, and for <code>build</code> select <code>node-repl</code>.</li>
<li>Load a file from your project with the command <code>ctrl+alt+c Enter.</code> Evaluating forms in Calva will show results in the output window. Synchronous <code>stdout</code> output will be printed in both the output window and in the terminal where you started the repl. Some asynchronous output may show up in the output window, but all will appear in the terminal.</li>
<li>Load a file from your project with the command <code>ctrl+alt+c Enter.</code> Evaluating forms in Calva will show results in the output destination. Synchronous <code>stdout</code> output will be printed in both the output destination and in the terminal where you started the repl. Some asynchronous output may show up in the output destination, but all will appear in the terminal.</li>
</ol>
<p>If you use an integrated VSCode terminal to start shadow-cljs, all <code>stdout</code> will appear in the Calva window with your code. Alternatively, you can use an external terminal, which is especially nice when using a second monitor.</p>
<p>If you use an integrated VSCode terminal to start shadow-cljs, all <code>stdout</code> will appear in the VS Code window with your code. Alternatively, you can use an external terminal, which is especially nice when using a second monitor.</p>
<p>For a discussion of this problem and other connection options, see <a href="https://github.com/BetterThanTomorrow/calva/issues/1468">issue #1468</a>.</p>


Expand Down
6 changes: 3 additions & 3 deletions clojuredocs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2090,7 +2090,7 @@ <h1 id="clojuredocs-integration">ClojureDocs integration<a class="headerlink" hr
</li>
<li>ClojureDocs information is included in the symbol lookup hovers, where each example has two buttons:<ul>
<li><strong>To Rich Comment</strong></li>
<li><strong>To Output Window</strong> </li>
<li><strong>To Output</strong></li>
</ul>
</li>
</ol>
Expand Down Expand Up @@ -2119,9 +2119,9 @@ <h2 id="clojuredocs-repl-surfing">ClojureDocs REPL Surfing<a class="headerlink"
<span class="w"> </span><span class="nv">trimmed-text</span><span class="p">)))</span>

<span class="p">(</span><span class="nf">comment</span>
<span class="w"> </span><span class="c1">;; = when-not - Example 1 = </span>
<span class="w"> </span><span class="c1">;; = when-not - Example 1 =</span>

<span class="w"> </span><span class="c1">;; build tuples over sets with the same cardinality </span>
<span class="w"> </span><span class="c1">;; build tuples over sets with the same cardinality</span>
<span class="w"> </span><span class="p">(</span><span class="nf">map</span>
<span class="w"> </span><span class="o">#</span><span class="p">(</span><span class="nb">when-not </span><span class="p">(</span><span class="nb">= </span><span class="nv">%2</span><span class="w"> </span><span class="nv">%3</span><span class="p">)</span><span class="w"> </span><span class="p">[</span><span class="nv">%1</span><span class="w"> </span><span class="nv">%2</span><span class="w"> </span><span class="nv">%3</span><span class="p">])</span>
<span class="w"> </span><span class="p">(</span><span class="nb">iterate inc </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="c1">; a lazy list of indices</span>
Expand Down
2 changes: 1 addition & 1 deletion connect-sequences/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2320,7 +2320,7 @@ <h2 id="settings-for-adding-custom-sequences">Settings for adding Custom Sequenc
<li><code>shouldOpenUrl</code>: Choose if Calva should automatically open the URL for you or not.</li>
<li><code>connectCode</code>: (required) Clojure code to be evaluated to convert the REPL to a CLJS REPL that Calva can use to connect to the application. (For some setups this could also conditionally start the CLJS REPL. If so: <code>startCode</code> should be omitted.)</li>
<li><code>isConnectedRegExp</code>: (required) A regular expression which, when matched in the <code>stdout</code> from the <code>connectCode</code> evaluation, will tell Calva that the application is connected. The default is <code>To quit, type: :cljs/quit</code> and you should leave it at that unless you know it won't work.</li>
<li><code>printThisLineRegExp</code>: regular expression which, when matched in the <code>stdout</code> from any code evaluations in the <code>cljsType</code>, will make the matched text be printed to the <a href="../output/">Output window</a>.</li>
<li><code>printThisLineRegExp</code>: regular expression which, when matched in the <code>stdout</code> from any code evaluations in the <code>cljsType</code>, will make the matched text be printed to the <a href="../output/">Output destination</a>.</li>
<li><code>buildsRequired</code>: Boolean. If the repl type requires that builds are started in order to connect to them, set this to true.</li>
</ul>
</li>
Expand Down
2 changes: 1 addition & 1 deletion debugger/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2652,7 +2652,7 @@ <h2 id="passing-options-to-the-repl-jvm">Passing options to the REPL JVM<a class
<span class="p">}</span>
</code></pre></div>
<p>Once you saved the file, the next time you <code>Jack in</code> the project, this variable is read by the JVM and the configuration is applied accordingly.</p>
<p>You should see something like the message below in the Calva terminal output window:</p>
<p>You should see something like the message below in the Calva jack-in terminal:</p>
<div class="highlight"><pre><span></span><code>clojure<span class="w"> </span>-Sdeps<span class="w"> </span><span class="s1">&#39;{:deps {nrepl/nrepl {:mvn/version,&quot;0.8.3&quot;},cider/cider-nrepl {:mvn/version,&quot;0.26.0&quot;}}}&#39;</span><span class="w"> </span>-A:debug<span class="w"> </span>-m<span class="w"> </span>nrepl.cmdline<span class="w"> </span>--middleware<span class="w"> </span><span class="s2">&quot;[cider.nrepl/cider-middleware]&quot;</span>
Picked<span class="w"> </span>up<span class="w"> </span>JAVA_TOOL_OPTIONS:<span class="w"> </span>-Dorg.slf4j.simpleLogger.defaultLogLevel<span class="o">=</span>TRACE<span class="w"> </span>-Xdebug<span class="w"> </span>-Xrunjdwp:transport<span class="o">=</span>dt_socket,server<span class="o">=</span>y,suspend<span class="o">=</span>n,address<span class="o">=</span><span class="m">7896</span>
Listening<span class="w"> </span><span class="k">for</span><span class="w"> </span>transport<span class="w"> </span>dt_socket<span class="w"> </span>at<span class="w"> </span>address:<span class="w"> </span><span class="m">7896</span>
Expand Down
4 changes: 2 additions & 2 deletions eval-tips/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2297,8 +2297,8 @@ <h2 id="evaluation-in-a-file-editor">Evaluation in a File Editor<a class="header
<li><strong>Inline.</strong> This will display the results (or some of it, if it is long) inline in the editor.</li>
<li>This also creates a hover pane including the full results and a button which will copy the results to the clipboard.</li>
<li>There is also a command for copying the last result to the clipboard.</li>
<li>The full results are always available in the <a href="../output/">output window</a>.<ul>
<li>There is a command for showing the output window, 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>
<li>The full results are always available in the <a href="../output/">output destination</a>.<ul>
<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>
</ul>
</li>
<li><strong>To comments.</strong> This will add the results as line comments below the current line.</li>
Expand Down
4 changes: 2 additions & 2 deletions evaluation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2297,8 +2297,8 @@ <h2 id="evaluation-in-a-file-editor">Evaluation in a File Editor<a class="header
<li><strong>Inline.</strong> This will display the results (or some of it, if it is long) inline in the editor.</li>
<li>This also creates a hover pane including the full results and a button which will copy the results to the clipboard.</li>
<li>There is also a command for copying the last result to the clipboard.</li>
<li>The full results are always available in the <a href="../output/">output window</a>.<ul>
<li>There is a command for showing the output window, 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>
<li>The full results are always available in the <a href="../output/">output destination</a>.<ul>
<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>
</ul>
</li>
<li><strong>To comments.</strong> This will add the results as line comments below the current line.</li>
Expand Down
4 changes: 2 additions & 2 deletions luminus/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2135,7 +2135,7 @@ <h2 id="server-shadow-cljs">Server + shadow-cljs<a class="headerlink" href="#ser
</ol>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Currently Calva has troubles following the app-start with shadow-cljs, so Calva will report <code>Jack-in done.</code> in the output window before shadow-cljs is actually done building the app. If you open the app page at that stage, you will see a message to “Please run <code>lein shadow watch app</code>”. Rest assured that <em>this is already underway.</em> Follow the Jack-in process in the <em>Terminal</em> tab in VS Code for the message that the app is built, <em>then</em> reload the app page in the web browser.</p>
<p>Currently Calva has troubles following the app-start with shadow-cljs, so Calva will report <code>Jack-in done.</code> in the output destination before shadow-cljs is actually done building the app. If you open the app page at that stage, you will see a message to “Please run <code>lein shadow watch app</code>”. Rest assured that <em>this is already underway.</em> Follow the Jack-in process in the <em>Terminal</em> tab in VS Code for the message that the app is built, <em>then</em> reload the app page in the web browser.</p>
</div>
<h2 id="server-only">Server Only<a class="headerlink" href="#server-only" title="Permanent link">#</a></h2>
<p>The workflow here is really just: Jack-in and start hacking. However, the first time it will involve these steps:</p>
Expand All @@ -2147,7 +2147,7 @@ <h2 id="server-only">Server Only<a class="headerlink" href="#server-only" title=
<div class="highlight"><pre><span></span><code>$<span class="w"> </span>code<span class="w"> </span>my-luminus-server
</code></pre></div></li>
<li>Use the Calva command <strong>Start a Project REPL and Connect (aka Jack-in)</strong>: <code>ctrl+alt+c ctrl+alt+j</code><ul>
<li>Select to start <strong>my-luminus-shadow Server</strong> and wait until you see <code>Jack-in done.</code> in the output window.</li>
<li>Select to start <strong>my-luminus-shadow Server</strong> and wait until you see <code>Jack-in done.</code> in the output destination.</li>
</ul>
</li>
<li>Open <a href="http://127.0.0.1:3000">127.0.0.1:3000</a> in your web browser and start hacking.</li>
Expand Down
8 changes: 4 additions & 4 deletions output/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2145,23 +2145,23 @@ <h2 id="commands-for-showing-output-destinations">Commands for showing output de
<span class="p">},</span>
<span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;key&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;ctrl+alt+o ctrl+alt+r&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;command&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;calva.showOutputWindow&quot;</span><span class="p">,</span><span class="w"> </span><span class="c1">// Show/Open REPL Window</span>
<span class="w"> </span><span class="nt">&quot;command&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;calva.showReplWindow&quot;</span><span class="p">,</span><span class="w"> </span><span class="c1">// Show/Open REPL Window</span>
<span class="w"> </span><span class="nt">&quot;args&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span>
<span class="p">},</span>
</code></pre></div>
</div>
<h2 id="about-stdout-in-the-repl-window">About stdout in the REPL Window<a class="headerlink" href="#about-stdout-in-the-repl-window" title="Permanent link">#</a></h2>
<p>Since Calva v2.0.423 the REPL Window prints <code>stdout</code> prepended with <code>;</code> to make it into line comments. This is because stdout output easily breaks the Clojure structure of the REPL Window, making it misbehave in various ways. We made this change because as maintainers of Calva we have seen all too often how this hits users, and it is also taking too much of our Calva time to try mitigate the problem, which is fundamentally not fixable.</p>
<p>There are now other output destinations that do not have this limitation.</p>
<p>All that said. If you want to keep using the REPL Window for stdout output, and need the old behavior, you can enable the setting: <code>calva.legacyPrintBareReplWindowOutput</code>. Please note that at some point after we have created a dedicated Output Window, the REPL Window will be retired as a destination for output.</p>
<p>All that said. If you want to keep using the REPL Window for stdout output, and need the old behavior, you can enable the setting: <code>calva.legacyPrintBareReplWindowOutput</code>. Please note that at some point after we have created a dedicated Output Window, the REPL Window will probably be retired as a destination for output.</p>
<h2 id="repl-process-output-stdout-and-stderr">REPL process output (stdout and stderr)<a class="headerlink" href="#repl-process-output-stdout-and-stderr" title="Permanent link">#</a></h2>
<p>When Calva is connected to the REPL, the Output window will by default print not only results of evaluations, but also:</p>
<p>When Calva is connected to the REPL, the Output destination will by default print not only results of evaluations, but also:</p>
<ol>
<li>Things printed to <code>stdout</code> and <code>stderr</code> in the <strong>main thread</strong> of the evaluations</li>
<li>Things printed to <code>stdout</code> and <code>stderr</code> from <strong>child threads</strong> of the evaluations</li>
<li>Anything printed to <code>stdout</code> and <code>stderr</code> by the REPL process</li>
</ol>
<p>You can control the default via the <code>calva.redirectServerOutputToRepl</code> setting. It defaults to <code>true</code>. Setting it to <code>false</code> before connecting the REPL will result in that <strong>2.</strong> and <strong>3.</strong> 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 <strong>Jack-in terminal</strong> if Calva started the REPL).</p>
<p>You can control the default via the <code>calva.redirectServerOutputToRepl</code> setting. It defaults to <code>true</code>. Setting it to <code>false</code> before connecting the REPL will result in that <strong>2.</strong> and <strong>3.</strong> will not get printed in the Output destination. It will then instead be printed wherever the REPL process is printing its messages, usually the terminal from where it was started (the <strong>Jack-in terminal</strong> if Calva started the REPL).</p>
<h2 id="see-also">See also<a class="headerlink" href="#see-also" title="Permanent link">#</a></h2>
<ul>
<li><a href="../inspector/">The Calva Results Inspector</a></li>
Expand Down
2 changes: 1 addition & 1 deletion re-frame-template/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2007,7 +2007,7 @@ <h1 id="how-to-use-calva-with-the-re-frame-template">How to use Calva with the r
<li><code>npm install</code></li>
<li>From VS Code, issue the command <strong>Calva: Start a Project REPL and Connect (a.k.a Jack-in)</strong>, <code>ctrl+alt+c ctrl+alt+j</code>.</li>
<li>Calva will auto-detect that this is a <code>shadow-cljs</code> project and ask for which build to compile.</li>
<li>Calva's output window will open and log some progress information.</li>
<li>Calva's output destination will open and log some progress information.</li>
<li>When prompted for which build to start, select <code>:app</code>.</li>
<li><code>:app</code> is the only configured build, but the VS Code menu for this is a bit strange so <em>make sure the <code>:app</code> checkbox is really ticked before proceeding</em>.</li>
<li>This will start the app, so in this workflow you don't do the <strong>Run application</strong> steps outlined below.</li>
Expand Down
Loading

0 comments on commit 280361b

Please sign in to comment.