<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions in Calva</title>
<link>https://ask.clojure.org/index.php/questions/tools/calva</link>
<description></description>
<item>
<title>How can I make Calva use a relative path when loading a file in cljs?</title>
<link>https://ask.clojure.org/index.php/14129/how-can-make-calva-use-relative-path-when-loading-file-in-cljs</link>
<description>&lt;p&gt;Is there a way to make &lt;code&gt;Calva: Load/Evaluate Current File and its Requires/Dependencies&lt;/code&gt; use a relative path for ClojureScript instead of an absolute path?&lt;/p&gt;
&lt;p&gt;I'm connecting to a docker container repl for development and the app is running at &lt;code&gt;/app&lt;/code&gt; inside the container. Loading the current file in Clojure works as expected and evaluating things that have already been loaded in ClojureScript works as expected. Loading the current file in ClojureScript fails because it uses the host machine's full path. I get the following error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;; ------ REPL Error while processing ---------------------------------------------
; (cljs.core/load-file &quot;/home/bmaddy/.../model/user.cljc&quot;)
; FileNotFoundException: /home/bmaddy/.../model/user.cljc (No such file or directory)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The following all work in the cljs repl as expected:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;;; absolute path inside the container
(cljs.core/load-file &quot;/app/src/.../model/user.cljc&quot;)
[]
;; relative path from project folder
(cljs.core/load-file &quot;./src/.../model/user.cljc&quot;)
[]
(cljs.core/load-file &quot;src/.../model/user.cljc&quot;)
[]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I see there are &lt;code&gt;JACK_IN_PROJECT_ROOT_PATH&lt;/code&gt; and &lt;code&gt;calva.replConnectSequences.projectRootPath&lt;/code&gt; settings, but they don't seem to affect this.&lt;/p&gt;
&lt;p&gt;Some version info:&lt;br&gt;
Calva version used: &lt;code&gt;v2.0.474&lt;/code&gt;&lt;br&gt;
clojure-lsp version used: &lt;code&gt;2024.08.05-18.16.00&lt;/code&gt;&lt;br&gt;
VSCode Version: &lt;code&gt;1.93.1&lt;/code&gt;&lt;br&gt;
OS: Linux&lt;/p&gt;
</description>
<category>Calva</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14129/how-can-make-calva-use-relative-path-when-loading-file-in-cljs</guid>
<pubDate>Mon, 23 Sep 2024 18:35:32 +0000</pubDate>
</item>
<item>
<title>Refresh/Reload deps.edn changes in Calva + VS Code in WSL Ubuntu</title>
<link>https://ask.clojure.org/index.php/14054/refresh-reload-deps-edn-changes-in-calva-vs-code-in-wsl-ubuntu</link>
<description>&lt;p&gt;Hi, I am new to Clojure and am following &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.youtube.com/watch?v=LqVyP_EGKqw&amp;amp;list=PLRGAFpvDgm2ylbXYIjvu3kI426zAP_Lqc&amp;amp;index=1&quot;&gt;this tutorial&lt;/a&gt; to make a Clojure API. This uses Cursive plugin in IntelliJ, but I am using Calva in VS Code.&lt;/p&gt;
&lt;p&gt;This is my project structure: &lt;/p&gt;
&lt;pre&gt;&lt;code&gt; .
├── deps.edn
├── resources
│   └── config.edn
└── src
    └── clojure_api
        ├── config.clj
        └── core.clj
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;My &lt;code&gt;config.clj&lt;/code&gt; file contents:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(ns clojure-api.config
    (:require [aero.core :as aero]
            [clojure.java.io :as io]))

(defn read-config []
  (-&amp;gt; &quot;config.edn&quot;
      (io/resource)
      (aero/read-config)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I changed my deps.edn file to add the paths &lt;code&gt;src&lt;/code&gt; &amp;amp; &lt;code&gt;resources&lt;/code&gt; like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:deps {aero/aero {:mvn/version &quot;1.1.6&quot;}} :path [&quot;resources&quot; &quot;src&quot;]}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;while keeping the &lt;code&gt;config.edn&lt;/code&gt; file an empty map: &lt;code&gt;{}&lt;/code&gt;. However, I could not read the config file from &lt;code&gt;read-config&lt;/code&gt; function in &lt;code&gt;config.clj&lt;/code&gt;. It gave this error in Calva repl: &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;; Execution error (IllegalArgumentException) at aero.core/read-config-into-tagged-literal (core.cljc:194).
; Cannot open &amp;lt;nil&amp;gt; as a Reader.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The tutorial &lt;a rel=&quot;nofollow&quot; href=&quot;https://youtu.be/LqVyP_EGKqw?list=PLRGAFpvDgm2ylbXYIjvu3kI426zAP_Lqc&amp;amp;t=421&quot;&gt;solved this error&lt;/a&gt; in Cursive by refreshing the project structure. I cannot seem to find any such commands in Calva. How can I update/refresh my project structure in Calva so that the &lt;code&gt;deps.edn&lt;/code&gt; changes are reflected in the repl?&lt;/p&gt;
&lt;p&gt;I have tried to restart the repl, reopening the folder in VS code, shuffling the &lt;code&gt;resources&lt;/code&gt; directory around to no avail.&lt;/p&gt;
&lt;p&gt;I could not find related answers to this problem after googling, so any help will be appreciated. &lt;/p&gt;
</description>
<category>Calva</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14054/refresh-reload-deps-edn-changes-in-calva-vs-code-in-wsl-ubuntu</guid>
<pubDate>Mon, 19 Aug 2024 15:16:49 +0000</pubDate>
</item>
<item>
<title>Is there a way to place the elements of a collection vertically with Calva?</title>
<link>https://ask.clojure.org/index.php/12126/there-way-place-elements-collection-vertically-with-calva</link>
<description>&lt;p&gt;I would like to know if i can pass from this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;[[1 2 3] [4 5 6] [7 8 9]]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;..to this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;[[1 2 3]&lt;/code&gt;&lt;br&gt;
&lt;code&gt;[4 5 6]&lt;/code&gt;&lt;br&gt;
&lt;code&gt;[7 8 9]]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;with Calva or another vscode shortcut instead of having to press enter in each item?&lt;/p&gt;
&lt;p&gt;Thanks in advance! :)&lt;/p&gt;
</description>
<category>Calva</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12126/there-way-place-elements-collection-vertically-with-calva</guid>
<pubDate>Thu, 25 Aug 2022 02:22:23 +0000</pubDate>
</item>
<item>
<title>Calva: Is there an option to add additional parameters when using &quot;jack-in&quot; in Calva</title>
<link>https://ask.clojure.org/index.php/11894/calva-there-option-additional-parameters-when-using-calva</link>
<description>&lt;p&gt;I was playing around with fulcro &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/fulcrologic/fulcro-template#the-api-server&quot;&gt;https://github.com/fulcrologic/fulcro-template#the-api-server&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In the readme of the fulcro-template, it said &lt;code&gt;clj -A:dev -J-Dtrace -J-Dguardrails.enabled=true&lt;/code&gt;  to start a backend server. And use any editor that has REPL integration, like Cursive.&lt;/p&gt;
&lt;p&gt;I can start repl using calva jack-in, but how can I add additional parameters like &lt;code&gt;-J-Dtrace -J-Dguardrails.enabled=true&lt;/code&gt;&lt;/p&gt;
</description>
<category>Calva</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11894/calva-there-option-additional-parameters-when-using-calva</guid>
<pubDate>Wed, 18 May 2022 12:04:21 +0000</pubDate>
</item>
<item>
<title>Calva: Is there a way to evaluate a whole file?</title>
<link>https://ask.clojure.org/index.php/11892/calva-is-there-a-way-to-evaluate-a-whole-file</link>
<description>&lt;p&gt;Beside selecting the whole file and then evaluating the selection, can I evaluate the whole file in a more convenient way?&lt;/p&gt;
&lt;p&gt;Adapted from questions asked in the &lt;code&gt;#calva&lt;/code&gt; channel at &lt;a rel=&quot;nofollow&quot; href=&quot;http://clojurians.net/&quot;&gt;Clojurians Slack&lt;/a&gt;.&lt;/p&gt;
</description>
<category>Calva</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11892/calva-is-there-a-way-to-evaluate-a-whole-file</guid>
<pubDate>Tue, 17 May 2022 14:33:43 +0000</pubDate>
</item>
<item>
<title>How to get Clojurescript REPL in Calva (Lein + Figwheel main)</title>
<link>https://ask.clojure.org/index.php/11759/how-to-get-clojurescript-repl-in-calva-lein-figwheel-main</link>
<description>&lt;p&gt;Hi, I trying to setup editor for Clojure, currently struggling with Calva. I have fullstack project (cljs via Figwheel main) and whe I run repl (jack-in) then both repls get started (Lein + Figwheel Main config), but I cant switch to cljs repl, geting error &quot;Cannot read properties of null (reading 'switchNS')&quot;&lt;/p&gt;
</description>
<category>Calva</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11759/how-to-get-clojurescript-repl-in-calva-lein-figwheel-main</guid>
<pubDate>Tue, 12 Apr 2022 04:27:18 +0000</pubDate>
</item>
</channel>
</rss>