This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # babashka (17)
- # beginners (82)
- # calva (42)
- # clj-commons (9)
- # cljdoc (2)
- # cljsrn (3)
- # clojure (142)
- # clojure-europe (12)
- # clojure-nl (1)
- # clojure-sg (1)
- # clojure-uk (14)
- # clojurescript (22)
- # community-development (3)
- # cryogen (12)
- # cursive (15)
- # data-science (13)
- # datomic (11)
- # deps-new (8)
- # emacs (3)
- # fulcro (31)
- # gratitude (7)
- # holy-lambda (8)
- # honeysql (6)
- # introduce-yourself (1)
- # jackdaw (11)
- # jobs-discuss (7)
- # kaocha (1)
- # malli (8)
- # other-languages (9)
- # pathom (14)
- # pedestal (1)
- # polylith (3)
- # portal (12)
- # re-frame (3)
- # react (3)
- # reagent (4)
- # releases (3)
- # reveal (7)
- # ring (11)
- # shadow-cljs (17)
- # specter (3)
- # sql (1)
- # timbre (2)
- # tools-deps (122)
- # xtdb (18)
I’m running a Calva deps clj project in one VSCode workspace, and a Calva shadow-cljs project in another. They have nicely separate clj and cljs repls up and running except that they appear to share a common output.calva-repl. I get prompts like this on every cljs repl command. Is there any way to avoid this?
It should be possible to use the same workspace, but people have had problems setting that up as well. But could be worth a try?
OK, will do. I did try a single workspace, but that made me share and switch a repl and organising the deps was really delicate. I could only get it working by connecting to a terminal started clj-repl and then using the shadow cli commands to switch to a cljs-repl. And it’s unpleasant having to switch repls.
Calva should use the CLJ repl in Clojure files and the CLJS one in ClojureScript files automatically. You mean that that was not happening?
It was getting very confused with dependencies when I tried that - I was using deps+shadow. The clj repl couldn’t find dependencies that were definitely in the deps, but when I ran in pure deps mode it could. So that started me on a search for alternatives.
Yeah, you’re in the but people have had problems setting that up cohort… I hope we will figure out the receipts for getting that to work.
Just tried that again and hit this on a shadow+deps jack-in while looking at app.cljs. This is what I saw:
clj꞉user꞉> ; Creating cljs repl session... ; Connecting cljs repl: deps.edn + shadow-cljs... ; The Calva Connection Log might have more connection progress information. ; Execution error (FileNotFoundException) at user/eval5213 (REPL:1). Could not locate shadow/cljs/devtools/api__init.class, shadow/cljs/devtools/api.clj or shadow/cljs/devtools/api.cljc on classpath. ; Error while connecting cljs REPL: TypeError: Cannot read property 'search' of undefined ; Jack-in done.
Or edit the jack-in CLI command used and add the dependency there. Then use that command to start the REPL and the Connect command from Calva.
Yeah I forgot to patch shadow back in to the deps on the retry. But I then get this issue, which is again caused by:
To quit, type: :cljs/quit Socket closed Socket closed Socket closed Socket closed Execution error (FileNotFoundException) at user/eval5213 (REPL:1). Could not locate shadow/cljs/devtools/api__init.class, shadow/cljs/devtools/api.clj or shadow/cljs/devtools/api.cljc on classpath. Socket closed
hi) would you please help me: I've installed VSCode with Calva on Windows 10. Is there a way to use a build-in leiningen from outside of VSCode? (from cmd or powershell, for example) Thanks!
Not sure I understand. If you mean if you can start the REPL from a terminal and connect Calva to it, then yes. See: https://calva.io/connect/#connecting-wo-jack-in
I want to run commands like "lein new ...", "lein run", "lein test" from Windows cmd or powershell and I prefer to use leiningen which is already build-in Calva. I don't want to have separate installation for leiningen.
Anyway, calva doesn't ship leiningen code in it, I think (never having used lein with calva, just deps.edn)
Calva doesn’t bundle anything lein. You have to use your local install. To connect Calva to the project’s REPL, you have to start it in a way that satisfies Calva’s dependency requirements. See the documentation for how to get Calva’s help with that.
Hey guys, I've recently started using Clojure professionally at work. In the past, I'd worked on hobby projects in Clojure and used intellij/cursive but at work I'd been using VS code for everything so decided to try out Calva to see where Clojure support was at. I'm working on a backend project, and one thing that's been extremely difficult to work with is being unable to see any java sources for the libraries I'm using in the project (i.e. being able to click on symbols and view their definitions, docstrings etc) Is there any way to get this working in Calva/VSCode?
Hi there! The support for Java can’t really compare with that of Cursive, but peeking at and navigating to code, as well as some completions works if you have the sources installed on your classpath. See this issue for some clues: https://github.com/BetterThanTomorrow/calva/issues/1304
There is also some work going on in clj-kondo about this, but currently only in the "what direction should we take phase"
I think it should be possible to extract at least method names, but where should you then direct the user when clicking on the method?
In cider-nrepl there is some attempt to look up sources online for Java things. I don’t know when it is supposed to be used, but maybe it is a feasible backup solution if the sources are not on the classpath?
in intellij, it sends you to the decompiled .class file and if available gives you the option to download the sources
Hi all. I need your help setting up my VS Code on Mac to work with Clojure. I followed the instructions at https://practical.li/clojure/clojure-editors/editor-install-guides/vscode-calva.html and https://practical.li/clojure/clojure-editors/editor-install-guides/vspacecode-calva.html, but it doesn’t work. For example, I’m in the newest version of VS Code for Mac; I create a new file by going to File --> New File; I click in the editing pane for Untitled-1; I press Shift-CTRL-P and nothing happens. What am I doing wrong? Here are the extensions I have installed and enabled:
the command palette specifically (which is that window where you can search for commands) can also be accessed from the "View" menu (and I think that'll show the shortcut as well). Fortunately, once you've got that shortcut down, you can use it to find pretty much any command, and at least on Windows, the command palette will also show you what the keyboard shortcut for that command is
It is interesting that you have to dig around quite a bit in the VS Code user docs to find out about the Command Palette … https://code.visualstudio.com/docs
> (Where should I have looked to find that out without having to ask on #calva?) I’m happy you asked here!