This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-10
Channels
- # announcements (16)
- # asami (7)
- # aws (5)
- # beginners (46)
- # calva (47)
- # clj-kondo (3)
- # cljdoc (23)
- # clojure (70)
- # clojure-germany (1)
- # clojurescript (6)
- # community-development (2)
- # datomic (3)
- # emacs (14)
- # exercism (5)
- # hyperfiddle (4)
- # jobs (1)
- # kaocha (9)
- # lsp (13)
- # malli (6)
- # membrane (11)
- # off-topic (22)
- # pedestal (4)
- # portal (19)
- # quil (3)
- # reagent (8)
- # remote-jobs (1)
- # shadow-cljs (48)
- # spacemacs (5)
There is no single command for that. The closest you get is Evaluate surrounding form, default shortcut ctrl+shift+enter
. You'll have to go up one form first, ctrl+up
(or go forward up ctrl+alt+down
), Then Cursor Undo (on mac cmd+u
. Putting it together: ctrl+up, ctrl+shift+enter, cmd+u
. There are some extensions that let you string commands and bind them to a shortcut, if this is too much finger exercise. 😃 Could be less of an exercise to go up two levels and evaluate current form: ctrl+up, ctrl+up, ctrl+enter, cmd+u, cmd+u
I don’t quite get why evaluate surrounding form concerns about the “” string pair. It would be more natural to directly evaluate on the () enclosing form.
Should it continue to do so for eval purposes? Is it possible to decouple the definition of list that Paredit uses from that which is used by eval operations?
So far I've been keeping it consistent on purpose. If a user who wants to check what would be evaluated by Evaluate Current Form can use Expand Selection (or Select Current form, depending) to investigate this, w/o actually evaluating anything. Similarly with Evaluate Surrounding Form (with Expand Selection x 2). I see it as a contract/promise. I made a short video about this recently: https://www.youtube.com/watch?v=8ygw7LLLU1w
Would users find it particularly confusing or contract violating when faced with the exceptional case of evaluation where there is a single "semantically fitting" discrepancy with other "Current Form" operations? I think it wouldn't be unreasonable to internalize that "Ah, because one never evaluates strings, when inside one, Eval Current Form behaves somewhat differently from otherwise, and evals the nearest evaluate-able form, and I understand this distinction and hopefully benefit from it"
I think it adds unnecessary complexity. Both for the user and for us. I'd probably not merge a PR adding this.
Hello! I am extremely new to Clojure and Calva, and I am trying to get the REPL up and running. The REPL with Leinengen is running, however I am not seeing the automatic results on my source file. I have attached a picture of what I expect to show, however it shows nothing. I can call it in the REPL window just fine though. I am on an M1 MacBook Pro, if that helps. . . Although, I am sure this is user error somehow
have you done the Getting Started REPL yet? https://calva.io/getting-started/
that should get you started and teach you the key chords needed to get eval results inline like you'd like
Starting the "Getting Started REPL" produces the following: java -jar '/Users/makeitekim/.vscode/extensions/betterthantomorrow.calva-2.0.265/deps.clj.jar' -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"0.9.0"},cider/cider-nrepl {:mvn/version,"0.27.4"}}}' -M -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]" Error building classpath. Expected edn map in: /private/var/folders/hl/OMITTED/T/betterthantomorrow.calva/kcbay8/deps.edn Jack-in process exited. Status: 1 I am reading through the guide, but it seems to indicate if you have a build tool (I use Lein), Java, VSCode, and Calva extension, it should just work. However, I may be reading over something crucial
Getting Started still doesn't work. However, I am able to get "=> output" working now. My Option Key was bound to my window manager, and thus auto-interpretation of functions wasn't able to be called
I for some reason thought that it would auto-evaluate a function just by clicking on the function, didn't know I needed to run a keyboard command each time
To the original expectation. Can you describe the steps you take before the expected results?
Sure, For using the getting started REPL 1. cmd+shift+p > "Calva: Fire Up the Getting Started REPL" 2. Create New Temp Directory 3. "Starting Jack-In terminal" 4. Error occurs due to empty end map in deps.edn file
If this helps, when it creates the Temp directory, the deps.edn file created is empty. Shown here with a cat command on the file.
Ahh, yeah they are basically the same 1. lien new app some-app-name 2. Open CLJ project in VS Code 3. Open core.clj 4. cmd-shift-p 5. > Clava: Start a Project REPL... 6. Leinengen 7. :uberjar 8. jack-in done 9. have to use Alt-Enter to evaluate current line
I think my only issue with the project repl was that I didn't understand I had to press Alt Enter every time (option enter on Mac)
Ah, thanks for clarifying that. Yes, you need evaluate things by command. See this page for an intro: https://calva.io/evaluation/
Are the other files also empty, @U03BL70M5A4?
also is this all running locally on your native OS or is it in WSL or a remote machine or similar?
@U03BL70M5A4: Don't select uberjar at step 7 there. Selecting nothing is probably best.
So, for the time being, now that I know what is supposed to be in the deps.edn file, I can manually bypass the error.
oh weird, you needed sudo
in theory you shouldn't need to do that... hmmm
It was a misconfiguration, @U03BL70M5A4. Try the command again now.
I should have said this, but I wasn't able to get it working on archlinux either, I really just assumed I was doing something wrong, but that makes sense