This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-24
Channels
- # announcements (30)
- # asami (9)
- # babashka (37)
- # beginners (120)
- # calva (26)
- # cider (3)
- # clara (9)
- # clj-commons (7)
- # clj-kondo (17)
- # cljsrn (2)
- # clojure (32)
- # clojure-europe (56)
- # clojure-nl (1)
- # clojure-norway (13)
- # clojure-uk (4)
- # clojurescript (34)
- # conjure (1)
- # copenhagen-clojurians (8)
- # core-async (21)
- # cursive (2)
- # datahike (2)
- # datascript (5)
- # events (4)
- # fulcro (32)
- # graalvm (10)
- # heroku (3)
- # introduce-yourself (1)
- # jobs (2)
- # lsp (3)
- # luminus (1)
- # malli (8)
- # meander (15)
- # minecraft (1)
- # nrepl (2)
- # off-topic (57)
- # pathom (2)
- # polylith (35)
- # reagent (6)
- # reitit (8)
- # releases (1)
- # rewrite-clj (7)
- # shadow-cljs (21)
- # timbre (4)
- # tools-build (1)
- # tools-deps (33)
- # vrac (8)
Hi there, I am on a shadowcljs project with multiples source paths, and I was wondering if the REPL launched by Calva can handle them. It seems that the REPL only knows default src/ source path. Do I need to use a custom REPL connection?
> It seems that the REPL only knows default src/ source path What trouble are you having? Is the repl unable to evaluate things in other paths, or are you not getting some other specific feature to work?
> Is the repl unable to evaluate things in other paths, yes, it can't find namespaces in a source path other than src/ (the require fails)
To be more precise, I want to use the debugger in a cljc file and the evaluation of the (ns (:require ...)) fails with ̀Could not locate ...`. It's a web app and in the browser it works well with the sources paths set in shadow-cljs.edn.
The debugger only works with Clojure, so I’m not sure it will/should work with .cljc files. I haven’t tried it, though. Regarding the require failing, it’s hard to say what the problem may be without some project for reproducing that I could look at. Feel free to create an issue and link to a repo in which you can reproduce the issue.
The debugger works, I'm using it all the time (the default REPL for cljc files is the clojure REPL). Yes I will create a minimalist project to reproduce the issue.
hmm ok, I found why with the minimalist project. I have to evaluate the required files first and then it works. Source paths tricked me that wasn't the point. Thanks for the help!
It does seem though that evaluating the required files first should not be required, as evaluating the file that requires them should in turn evaluate those files. The fact that that doesn’t happen may be related to source paths, though. If you still feel something isn’t happening that should be, please file an issue.
I think you got the point, that's why I was in troubled this time and not usually. I'll try to reproduce this again in the minimalist project I've made and create an issue.
👋 hey all, my editor is suddenly not placing the cursor at the proper indentation level after starting a new line. I’m sure this is something simple, but I can’t find the proper setting that would have caused this. Has anyone encountered this before?
Oddly it seems to place the closing paren in the correct place, it’s just the cursor itself that is incorrectly placed at the beginning of the line
Ah! Turning off this New Indent Engine
setting seems to have fixed that problem. Not sure what I’ve opted out of tho…
I was seeing strange indentation behavior on new lines recently and wasn't sure why. I'll try turning this off and see if it improves. Thanks.
Interesting find. Very strange though. In theory (made from my understanding of how I have wired these things) it shouldn’t matter which indent engine you use in relation to the problem reported. I’ll need to tale a good look at it…
I do use the vim extension, like you said in the other thread. Maybe something with the new indent engine is conflicting with that plug-in.
It's a recently introduced conflict. https://github.com/VSCodeVim/Vim/issues/6992 You could add that finding to the issue, @U6GFE9HS7 , that the old indent engine works for you. Though I think it might be a matter of timing. The old engine is much slower so “wins“ over the VIM extension by getting later to the party.
Hello, is there a way to get the quoted form for use in a custom repl command? https://calva.io/custom-commands/
Going from the examples I tried something like: "snippet": "(quote $current-form)"
but it resulted in just $current-form
as a symbol, not the expression itself quoted.
Hmm, very interesting question. It’s late here and my brain is not working, but anyway, all that is happening with these snippets is that Calva will replace $current-form
and send it to the repl. Can you elaborate a bit more on what happens when you try it and what you want to happen?
Lets say I evaluate that custom command with (do :foo)
as $current-form
, i would expect it to result in '(do :foo)
(the quoted version), instead I get, literally, '$current-form
With this snippet definition:
"calva.customREPLCommandSnippets": [
{
"name": "foo",
"snippet": "(quote $current-form)"
}
]
I get (do :foo)
as the result.@U0ETXRFEW sorry, my minimal reproduction was too minimal 🙂 , it is an issue if you use $current-form
twice in the snippet, like so:
"calva.customREPLCommandSnippets": [
{
"name": "foo",
"snippet": "(vector $current-form (quote $current-form))"
}
]
This will output for the expression (do {:foo :bar})
:
(vector (do {:foo :bar}) (quote $current-form))
[{:foo :bar} $current-form]