This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-23
Channels
- # adventofcode (21)
- # announcements (4)
- # babashka (35)
- # beginners (36)
- # calva (76)
- # cider (16)
- # clj-kondo (24)
- # clj-on-windows (12)
- # clojure (70)
- # clojure-europe (7)
- # clojure-nl (13)
- # clojure-spec (3)
- # clojure-uk (3)
- # clojurescript (34)
- # conjure (11)
- # cursive (22)
- # datomic (30)
- # deps-new (2)
- # emacs (36)
- # fulcro (28)
- # gratitude (4)
- # honeysql (16)
- # hugsql (8)
- # introduce-yourself (6)
- # jobs (1)
- # malli (4)
- # missionary (6)
- # off-topic (129)
- # other-languages (34)
- # polylith (3)
- # reagent (9)
- # reitit (27)
- # releases (13)
- # remote-jobs (1)
- # reveal (1)
- # shadow-cljs (2)
- # tools-build (3)
- # tools-deps (18)
- # web-security (7)
- # xtdb (4)
Good morning, I'm trying "Evaluate form and replace result" but in my case I want to avoid the *print-length*
limitation. I tried binding it to false but it doesn't work for Calva.
Not sure, but we could be using the calva.prettyPrintingOptions: maxLength
option for this. There is no separate setting for that for the eval-replace case at least…
Thanks! The pretty-printing is nice otherwise it ends up in a huge line. I will try disabled it temporarily.
Setting maxLength
to null
should give you all the elements, but otherwise keep pretty printing things. Was that what you tried?
(That is, the form I'm trying to evaluate results in a big list, and I want that entire list printed out)
In attached image, I evaluate a form first in a clj repl, then I switch to a cljs repl and evaluate the same form again. The image features two unexpected things I regularly come across:
1. The prompt still says clj:...
even though I switched to a cljs repl. I see this is actually the case even if I evaluate a purely cljs file (so can only connect to a cljs repl).
2. The result does not pretty print in the cljs repl.
Are these issues or are my expectations wrong or I'm doing something wrong? Thanks!
About the pretty printing. I'm not sure if it is supposed to work. But if you switch to client side pretty printing, that should work. (The calva
pretty print engine.)
> I merged a PR that might fix that some days ago. We should release that fix. Sorry, was running a previous version. Updating to the latest, don't have that problem anymore.
> But if you switch to client side pretty printing, that should work. (The `calva` pretty print engine.)
It does, thanks. So, when working in cljs I should manually change the setting to calva
. When working in clj I switch back to pprint
?
Right, sorry. What I'm really asking is: is that the only way to switch back and forth between them?
If it is something we can't expect to work we could make Calva always use client side for cljs.
The only way to switch engines is through settings. I think there are extension that make toggling settings convenient.
Ah, yes, maybe when the data readers are not available to the JVM repl (where the nREPL server runs) it doesn’t work. On the Calva side of things that doesn’t matter, because it is all static.
Hey everyone! I'm wondering about repl-driven development in the frontend. I'm working with re-frame a lot and I was wondering how to integrate the repl here. Could you share some insight into your workflow?
Hello! I work with re-frame frequently lately. Can you describe what you mean by “integrate the repl”? What’s your JS/CLJS target? Is it a browser app, a nodejs app, a react-native app, something else (if there is)? In my case, with a react-native app, using shadow-cljs, I run Calva’s jack-in command and select shadow-cljs and the build I want to connect to. Once the repl starts, in order to evaluate code in the repl, your runtime needs to be connected. In my case, my runtime is my react-native app, running in an emulator (for example). Once the app is running, I can evaluate code from my editor, or from the repl prompt in the Calva output window.
Yes! This is exactly what I'm asking for. More specifically though, I'd like to know how you use the repl in actual development. I went through the calve hello_repl tutorial a couple of weeks ago and the stuff I learned seems cool. But I'm wondering if people actually use these things when hot reloading is already pretty immediate interaction.
Yes, it depends on what you’re trying to do perhaps, but the repl is still valuable even when using hot reloading. For example, I might pull in a library and want to test some calls using that library from the repl, without integrating the code into my app first.
Maybe I want to make direct http calls to some service to inpect the data I get back using the repl.
Or, I want to test a transformation with the repl before adding the transformation to my app code. For example:
(-> http-response
:data
(do-something))
And then once I have the final form I want the data in for my app, I copy the code into some function used by the app.
Not sure if this is a question here or #clj-kondo, I have imported a lib (https://github.com/Engelberg/better-cond) that has a clj-kondo options for how to lint the macros, but when I use those macros they are not properly linted and clj-kondo report errors. Is there something I need to do/add for this to work?
according to this config it should work: https://github.com/Engelberg/better-cond/blob/4720bd8bcfd1adc1197b8d5f07873bc46008d333/resources/clj-kondo.exports/better-cond/better-cond/config.edn#L5
yes, this is my import
(:refer-clojure :exclude [sorted-map sorted-map-by sorted-set sorted-set-by first last when-let])
(:require [clojure.data.avl :as avl]
[better-cond.core :refer [when-let]])
This is something that @U0ETXRFEW might now (the versions)
also, check if there is .clj-kondo/better-cond/better-cond
if it should be inside my project’s clj-kondo, it isn’tI am having another problem now, it seems it’s linting it as a normal when-let now:
(ns volus.dev
(:refer-clojure :exclude [when-let])
(:require [better-cond.core :refer [when-let]]))
(when-let [a 1
b 2]
(println (+ a b)))
this tells me when-let should have exactly 2 formsIt seems better-cond config has a bug, here:
better-cond.core/when-let clojure.core/when-let
done, was a bit delayed by my mess on local git credentials https://github.com/Engelberg/better-cond/pull/21
I'm new to Calva, fresh Vscode install, fresh Calva, fresh MacOS and I'm getting this weird bug where syntax highlighting doesn't update unless I close the file and reopen. Essentially the syntax highlighting is fixed to the line number and doesn't follow the actual code it refers to. Anyone seen this before?
For example in this photo str has three different colors..
If I open a directory with less files, it seems to work. Could be a file watcher issue? Coworker in same folder doesn't have the issue though
Could this be a semantic tokens issue, @UKFSJSM38 ?
I was seeing this too, but it went away when I applied the fix here: https://clojurians.slack.com/archives/CBE668G4R/p1640048783488600?thread_ts=1640017230.483900&cid=CBE668G4R
I rolled back the versions and 2.0.201 (6months ago) is working as expected. I also tested 2.0.211 (3 months) and it still had the issue. I'll try the above fix this later tonight and report back. Thanks!
Just linking the two threads: https://clojurians.slack.com/archives/CPABC1H61/p1640530722287300