This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-31
Channels
- # adventofcode (15)
- # announcements (8)
- # babashka (16)
- # beginners (48)
- # braveandtrue (5)
- # calva (54)
- # cider (7)
- # clara (8)
- # clj-kondo (3)
- # cljdoc (3)
- # clojure (37)
- # clojure-europe (1)
- # clojure-italy (15)
- # clojure-losangeles (2)
- # clojure-nl (15)
- # clojure-uk (6)
- # clojurescript (145)
- # community-development (53)
- # cursive (20)
- # data-science (8)
- # datomic (23)
- # duct (2)
- # emacs (22)
- # fulcro (16)
- # gorilla (7)
- # graalvm (7)
- # hoplon (1)
- # malli (7)
- # off-topic (8)
- # rewrite-clj (2)
- # ring (9)
- # spacemacs (2)
- # specter (1)
- # tools-deps (25)
- # vrac (1)
Hi, as a new clava user on macbook, the default keybinding ctl-alt-c is not so convenient as macbook right side has no ctl key, what if I change it to cmd-alt-c?
I use an emacs keybinding and remapped everything to their emacs equivalents and it all still works. If you can find something that doesn't conflict with anything else you're doing, roll with it.
Hiyo! Very new to both Calva and Clojure, But I'm confused...I've installed Calva in VS Code and jacked in. But when I perform tasks like Evaluating a file, or running tests, I get a output that it is going to do the thing, but doesn't let me know that anything completed, or test results.
To boot, when I go in to REPL and attempt to evaluate anything, it just hangs too. So...I'm not sure how I broke something this fast.
I'm not really sure these will be useful for anyone else, but I use https://marketplace.visualstudio.com/items?itemName=lfs.vscode-emacs-friendly with these settings:
{
"key": "ctrl+c alt+j",
"command": "calva.jackIn"
},
{
"key": "ctrl+alt+c ctrl+alt+j",
"command": "-calva.jackIn"
},
{
"key": "ctrl+c ctrl+t",
"command": "calva.runNamespaceTests",
"when": "calva:connected"
},
{
"key": "ctrl+alt+c t",
"command": "-calva.runNamespaceTests",
"when": "calva:connected"
},
{
"key": "ctrl+c ctrl+shift+t",
"command": "calva.runAllTests",
"when": "calva:connected"
},
{
"key": "ctrl+alt+c shift+t",
"command": "-calva.runAllTests",
"when": "calva:connected"
},
{
"key": "ctrl+c t",
"command": "calva.runTestUnderCursor",
"when": "calva:connected"
},
{
"key": "ctrl+alt+c ctrl+alt+t",
"command": "-calva.runTestUnderCursor",
"when": "calva:connected"
},
{
"key": "ctrl+c ctrl+e",
"command": "calva.evaluateSelection",
"when": "calva:connected"
},
{
"key": "ctrl+alt+c e",
"command": "-calva.evaluateSelection",
"when": "calva:connected"
},
{
"key": "ctrl+c ctrl+p",
"command": "calva.evalCurrentFormInREPLWindow",
"when": "calva:connected"
},
{
"key": "ctrl+alt+c ctrl+alt+e",
"command": "-calva.evalCurrentFormInREPLWindow",
"when": "calva:connected"
},
{
"key": "ctrl+c ctrl+r",
"command": "calva.evaluateSelectionReplace",
"when": "calva:connected"
},
{
"key": "ctrl+alt+c r",
"command": "-calva.evaluateSelectionReplace",
"when": "calva:connected"
},
{
"key": "ctrl+c ctrl+k",
"command": "calva.loadFile",
"when": "calva:connected"
},
{
"key": "ctrl+alt+c enter",
"command": "-calva.loadFile",
"when": "calva:connected"
},
{
"key": "ctrl+c ctrl+n",
"command": "calva.loadNamespace",
"when": "calva:connected"
},
{
"key": "ctrl+alt+c ctrl+alt+n",
"command": "-calva.loadNamespace",
"when": "calva:connected"
},
{
"key": "ctrl+g",
"command": "calva.clearInlineResults",
"when": "editorTextFocus && !editorHasMultipleSelections && !editorReadOnly && !hasOtherSuggestions && !parameterHintsVisible && !suggestWidgetVisible && editorLangId == 'clojure'"
},
{
"key": "escape",
"command": "-calva.clearInlineResults",
"when": "editorTextFocus && !editorHasMultipleSelections && !editorReadOnly && !hasOtherSuggestions && !parameterHintsVisible && !suggestWidgetVisible && editorLangId == 'clojure'"
},
{
"key": "ctrl+c ctrl+c",
"command": "calva.copyLastResults"
},
{
"key": "ctrl+alt+c ctrl+c",
"command": "-calva.copyLastResults"
},
This is a work-in-progress.
@andy102, that was fast indeed. 😃 It sounds like something is up with the REPL connection. Can you provide the steps you take from opening the project and on? Also any error messages from the jack-in terminal would be useful.
No real error messages is the odd thing:
> Executing task: lein update-in :dependencies conj '[nrepl"0.6.0"]' -- update-in :plugins conj '[cider/cider-nrepl"0.22.4"]' -- update-in '[:repl-options :nrepl-middleware]' conj '["cider.nrepl/cider-middleware"]' -- with-profile +uberjar repl :headless <
OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
nREPL server started on port 49669 on host 127.0.0.1 -
Steps:
1. Jackin
2. "Lein"
3. :uberjar
Really just took the defaults.
This has previously worked with lein run
and lein test
, but adding Calva (which I like for a better editing experience) has stopped finding and running tests or really completing any tasks at all.
Thanks for the help.
False alarm, I think I created an endless loop while trying to figure out how to recurse
and hence things were hanging.
😞 More to learn
Hey, I installed parinfer, but just reading the calva docs (yeah, should have read them first!) And I see calva has its own paredit .... Should I remove parinfer??
@cam.asoftware, you should be able to use both, I think the settings needed for that are documented as well. However, unless you are really hooked on parinfer, it is not needed. Calva sports among the best paredit implementations out there.
Thanks @pez I'm not hooked at all on parinfer, I just had assumed that to ease the entry to lisp I should use it, but really pleased to see calva offers this. Was just reading your vision on calva (very well written btw) and indeed, the built in handling of parens is definitely inline with the vision of keeping the barrier to entry low. I've listened to you on defn podcast, and as a newcomer, I think this is a great feature that is probably worth highlighting a bit more. As a n00b, we don't know of the paredit/parinfer editor enhancements, because we don't know about the parens/formatting of Clojure. One of those, "you don't know what you don't know" scenarios
But now that I have played in the repl, I'm hooked. Here is a feature idea, food for thought: imagine being able to place markers in the gutter at the beginning of one or more forms (like the idea of breakpoints) Then, when the editor saves a file, each form is automatically evaluated (top to bottom) in the repl, or inline (based on user preferences) this would allow Devs to, for example, create a data structure, a function, and a function call. So they would mark all three forms..... Modify to their hearts content.... Save, and bingo, evaluation shows the result(s)
You could just have a function call with your data structure at the end of the ns so it would automatically run on evaluation?
Hey Cam. I'm not sure if you're aware of the Eval on Save setting. You can check this in Calva's settings and your file will be evaluated on save.
If you want to pick and choose which things evaluate "at once". You can add them in a comment
form in your file and either evaluate each one individually or add them all inside a do
form and evaluate the top-level do
which will evaluate all forms inside it.
I've been considering an open source contribution, so as long I can write such a thing for calva in cljs, then I'd love to have a go 😁
Someone floated an interesting idea the other day, that your suggestion sort of touches. Iirc, it was about Calva keeping track of, and showing, the evaluation status of the top level forms. That way you would see when forms you rely on need to be re-evaluated. Not sure if that was suggested just here or if someone filed an issue about it, but anyway, I think it would take us a long way towards control of the evaluation process.
If I understand you correctly, Cider does that. The gutter shows a green line next to forms that havn't changed since last evaluated.
Right! Yes, that makes sense too. For me, it's about keeping shortcut key and cursor movements to a minimum. On a scale of 1-10, how hard would that be to implement do you think @pez?
I imagine markers that are always evaluated as a result of some event would be easier. Then there is no need to keep track of existing forms
I think it would be pretty hard to get the ux right for those markers. And they would need to be structural anyway.
In the simplest first cut, perhaps just a marker against a form. Fully fledged, yeah harder for sure
So probably more work with the markers. And less general. So I'm leaning towards the idea of keeping track of the eval status on every form in the he file. It can later be amended with that we can mark specific forms.
We should have a zoom session about it (the implementation), I think. There are quite a few things I haven't documented properly yet.
I think it should be visualized a bit like the eval markers today. But maybe just in the gutters.
I think there are fresh APIs for this for the mini map, so a glance at that should tell you what's the status.
Hmmmm, or even, when the user evals a form, we identify that a form/var the form depends upon requires eval, and just eval it on their behalf?
I'm a bit on the defense with such help. But something that tells you that you are using an old definition, maybe?
I can do a short zoom now, if you can, @cam.asoftware
You could just have a function call with your data structure at the end of the ns so it would automatically run on evaluation?
Not sure about code/calva. I use clj -Stree
like in javascript for example, my node_modules are in my project directory, so can easily reference them whereas in clojure they are in my HOME directory (they all seem to be installed globally?) but was using cursive briefly and saw they load them for me and allow me to see them
I’m very interested in what Cursive does here, so if you get the time, please describe it. Here’s what I do in Calva.
I get the feeling @UPH6EL9DH isn't talking about code navigation, but wants to know how to actually look at what dependencies are in play. I use clj -Stree
if that is what he means.
Actually, now that I read this, I think I am totally wrong.
specific scenario is error pops up in repl about a library i'm using, so since it doesn't look like I can click/open specified code line in repl logs, i was looking for ways to navigate to library myself @pez i'm not too familiar with cursive unfortunately so can't comment; i was just using it to compare experiences. but i wasn't aware you could click on require statements like that, so gif is helpful thanks