This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-06
Channels
- # announcements (12)
- # asami (3)
- # babashka (59)
- # beginners (20)
- # biff (1)
- # calva (87)
- # cherry (8)
- # clj-kondo (41)
- # clj-together (4)
- # cljdoc (5)
- # cljfx (4)
- # cljs-dev (2)
- # cljsrn (6)
- # clojure (63)
- # clojure-europe (22)
- # clojure-nl (1)
- # clojure-norway (35)
- # clojure-uk (4)
- # clojurescript (5)
- # conjure (2)
- # datalevin (4)
- # datascript (8)
- # datomic (16)
- # events (1)
- # figwheel-main (1)
- # fulcro (9)
- # hyperfiddle (4)
- # introduce-yourself (1)
- # jobs (3)
- # kaocha (10)
- # lambdaisland (2)
- # lumo (7)
- # nbb (1)
- # off-topic (29)
- # pathom (15)
- # re-frame (80)
- # releases (1)
- # remote-jobs (4)
- # shadow-cljs (13)
- # spacemacs (9)
- # sql (25)
- # squint (32)
- # tools-deps (6)
- # uncomplicate (6)
- # xtdb (15)
Dear Calva friends: https://github.com/BetterThanTomorrow/calva/releases/tag/v2.0.299 • https://github.com/BetterThanTomorrow/calva/issues/1853 • Fix: https://github.com/BetterThanTomorrow/calva/issues/1855
I am having trouble using Reveal with Calva. Steps I followed:Set up a deps.edn as instructed here: https://calva.io/reveal/; create a new clj file in the same directory; jack in using the reveal-nrepl-middleware alias; evaluate anything in the new CLJ file buffer. Expected result: Evaluation result shows up in Reveal: Actual result: Evaluation result only shown in Calva. Suggestions?
I think I can tap to the Reveal window - haven’t tried recently - but it does not echo REPL evals.
When I try this with a minimal deps.edn project, it works as advertised. Have you tried that? Thinking it could be something in your project preventing the middleware from doing its thing.
I tried it with a project with one deps.edn exactly as described in the instructions - nothing else present - and one CLJ file in VS Code, which was empty except for the ns macro and a single eval, which did not then go to the Reveal window.
Strange. You can try with removing Calva from the picture. In one terminal do:
% clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"1.0.0"},cider/cider-nrepl {:mvn/version,"0.28.5"}}}' -A:reveal-nrepl-middleware
And then when the nREPL server is started, in another terminal:
% clojure -Sdeps '{:deps {reply/reply {:mvn/version "0.5.1"}}}' -M -m reply.main --attach `< .nrepl-port
`
You should get a user=>
Clojure prompt. Anything I evaluate there goes to the Reveal window.Thanks. I like the “divide and conquer” suggestion. However, I won’t be able to try it until a bit later. I’ll let you know what happens. Again, I appreciate the help so far.
I'm using the latest Reveal, the one mentioned in the Calva docs is pretty ancient.
:reveal-nrepl-middleware
{:extra-deps {vlaaad/reveal {:mvn/version "1.3.275"}}
:jvm-opts ["--add-opens" "javafx.graphics/com.sun.javafx.tk=ALL-UNNAMED"]
:main-opts ["-m" "nrepl.cmdline"
"--middleware" "[vlaaad.reveal.nrepl/middleware,cider.nrepl/cider-middleware]"]}
OK - my Reveal version could be part of the problem. Thanks. Being a relative noob I tend to follow instructions literally, unfortunately.
But I will try this and report back.
:thumbsup:
Docs updated. I also created a minimal example project with a README suggesting the terminal-only approach to test that things work: https://github.com/BetterThanTomorrow/calva/tree/published/test-data/projects/minimal-reveal
Excellent. Thanks.
@U0ETXRFEW I still hope to apply your recommendations soon, but things have taken me away from this activity for a day or two. I will make sure to let you know if it worked once I get the chance. Thanks again.
@U0ETXRFEW My experiment was mostly unsuccessful. When I tried the two terminal trick, it worked. The results of anything I evaluated at the REPL prompt was repeated in the Reveal window. I then created a tiny project with just your :reveal-nrepl-middleware alias in it and one source file with a couple of lines, and I jacked into it using Calva. This did not work. Evaluation results were shown in the source file and the Calva output window, but not in the Reveal window. Thinking I might have missed something stupid, I cloned the whole of Calva from Github, navigated down into test-data/projects/minimal-reveal, and jacked in from hello.clj. Once again I was unsuccessful. Results were shown in the source file and the Calva output window, but not in the Reveal window. Do you have any suggestions for next steps I might attempt, either diagnostic or even - hopefully - curative? Many thanks for the help so far. I still have hope that, with perseverance, this can be resolved eventually.
Oh, wow, super surprised here that it didn't work in Calva while it worked using the the terminals. That sort of makes me doubt what I thought I know about how these things work. 😃 I'm a bit out of ideas now... Maybe if you describe the steps you take, and paste what you see in the jack-in window and such we can find some clue. Also, what OS are you on?
I am on macOS Catalina 10.15.7.
(Yeah, I know.)
My JDK is OpenJDK Runtime Environment Temurin-17.0.1+12 (build 17.0.1+12).
VS Code 1.71.1 (Universal)
Calva [2.0.300] - 2022-09-11
Thanks. I seriously doubt it has anything to do with the version of anything, and all those look cool to me.
I will go ahead with the copy/paste idea. I know we haven’t worked together, but if it helps eventually, I would be open to a quick Zoom call or something.
I’m at work - let me check my calendar.
OK I can do that.
Here is my nRepl log:
-> sent { id: ‘17’, op: ‘eval’, session: ‘87518300-30b3-4e51-a715-13a4e0c1345b’, code: “(in-ns ’calvrev)“, pprint: false } <- received { id: ‘17’, ns: ‘calvrev’, session: ‘87518300-30b3-4e51-a715-13a4e0c1345b’, value: ‘#namespace[calvrev]’ } <- received { id: ‘17’, session: ‘87518300-30b3-4e51-a715-13a4e0c1345b’, status: [ ‘done’ ] } <- received { ‘changed-namespaces’: {}, id: ‘17’, ‘repl-type’: ‘clj’, session: ‘87518300-30b3-4e51-a715-13a4e0c1345b’, status: [ ‘state’ ] } -> sent { op: ‘load-file’, session: ‘87518300-30b3-4e51-a715-13a4e0c1345b’, file: ‘(ns calvrev)\n\n1’, id: ‘18’, ‘file-name’: ‘calvrev.clj’, ‘file-path’: ‘/Users/alanbirchenough/clojure/calvrev/calvrev.clj’ } <- received { id: ‘18’, session: ‘87518300-30b3-4e51-a715-13a4e0c1345b’, value: ‘1’ } <- received { id: ‘18’, session: ‘87518300-30b3-4e51-a715-13a4e0c1345b’, status: [ ‘done’ ] } <- received { ‘changed-namespaces’: {}, id: ‘18’, ‘repl-type’: ‘clj’, session: ‘87518300-30b3-4e51-a715-13a4e0c1345b’, status: [ ‘state’ ] } -> sent { op: ‘debug-instrumented-defs’, id: ‘19’, session: ‘87518300-30b3-4e51-a715-13a4e0c1345b’ } <- received { id: ‘19’, list: [], session: ‘87518300-30b3-4e51-a715-13a4e0c1345b’, status: [ ‘done’ ] } -> sent { id: ‘20’, op: ‘eval’, session: ‘87518300-30b3-4e51-a715-13a4e0c1345b’, code: ‘1’, file: ‘/Users/alanbirchenough/clojure/calvrev/calvrev.clj’, line: 3, column: 1, stdout: [Function: stdout], stderr: [Function: stderr], pprint: false } <- received { id: ‘20’, ns: ‘calvrev’, session: ‘87518300-30b3-4e51-a715-13a4e0c1345b’, value: ‘1’ } <- received { id: ‘20’, session: ‘87518300-30b3-4e51-a715-13a4e0c1345b’, status: [ ‘done’ ] } <- received { ‘changed-namespaces’: {}, id: ‘20’, ‘repl-type’: ‘clj’, session: ‘87518300-30b3-4e51-a715-13a4e0c1345b’, status: [ ‘state’ ] } -> sent { op: ‘debug-instrumented-defs’, id: ‘21’, session: ‘87518300-30b3-4e51-a715-13a4e0c1345b’ } <- received { id: ‘21’, list: [], session: ‘87518300-30b3-4e51-a715-13a4e0c1345b’, status: [ ‘done’ ] }
A thing to try, that mimics the reply
experiment a bit closer, is to use the REPL Window to evaluate 42
, without loading any file.
OK - will try that.
Checking the REPL-y README I get reminded that that is what Leiningen is using. I still think it's a valid data point to check with lein repl :connect
, but anyway. 😃
Right - thanks for clarification. I went there and saw the same thing, but will keep the test in the plan anyway.
I notice that REPL-y is using nREPL 0.8.3. So a thing to try is with the Calva Connect scenario and edit the command line to use that version.
Still we also have the data point that things work on my machine, with the nREPL 1.0, but, turning every stone and all that...
I hope to get back to you before the end of the week with results. (Fingers crossed.)
First result: Evaluating 42 in the REPL window does not result in output appearing within the Reveal window.
@U47G49KHQ, we have a super strange issue here with using Reveal together with Calva. When I follow the information found here https://calva.io/reveal/ things work. When @U039K02M4UB follows the same information it does not work. The extra strange thing is that it almost works. When loading a Clojure file in the Calva REPL, the result of evaluating the file is echoed in the Reveal window. But a ”plain” evaluation of some expression does not get echoed. Also, if Alan just uses a terminal nREPL client (REPL-y), things work. We're a bit out of ideas on what to try. Do you have any ideas?
@U0ETXRFEW I can confirm that REPL-y works, and lein repl :connect
also works (as we expected).
It is almost unimaginable the timing here. This just out in #announcements https://clojurians.slack.com/archives/C06MAR553/p1663308071949609
I'll be sure to take a look.
@U0ETXRFEW I will compile everything we know so far using the different scenarios, and including the logs provided by the Lambda Island tool.
It wasn't such a magical timing thing as I thought. It was my question in that ^ issue that got @U051BLM8F to ask @U07FP7QJ0 to make a proper release of this proxy tool. It has existed for a year or so. 😃 (Iiuc).
Interesting.
Well it still is magical in the sense that the community is generously and intelligently doing its thing, but I guess it’s a less spooky kind of magic than we might have initially thought.
@U0ETXRFEW I hope to make progress in compiling the scenario information over the next few hours.
The Clojure tool smith community is fantastic. I am so happy and proud to be part of it. Don't know if you've seen my #clojured 2021 talk? It has this tool smith community as its main theme. https://www.youtube.com/watch?v=NIk5hVzA_fY
Not yet. I look forward to seeing it this weekend.
@U0ETXRFEW You’re not going to believe this, but I have fixed this issue using the dumbest approach imaginable. I just deleted my Application Support folders and my ~/.vscode folder and started over with a clean setup of VSCode, installed Calva, ran the minimal project and … it worked!
Before that I spent most of this afternoon logging nREPL messages using the Lambda Island library, which is pretty nifty, but unfortunately did not uncover anything useful in this particular case.
I am sorry to have taken up so much of your time on this matter, but at least I:
• Got to make your acquaintance in person - very cool; AND
• Learned a whole bunch about nREPL.
I’ll probably head over to Amazon and get a premium Calva T-shirt to mark the occasion. Thanks again for your patience!
How very, very odd! But great that it now works. And with great side effects. It was a pleasure trying to be of help here, as well as meeting, getting a face (almost). Enjoy that Calva t-shirt!
@U0ETXRFEW I agree about the “side effects”, and thanks again for meeting with me. The T-shirt is due to arrive today! Best wishes, A.
While waiting you could consider submitting a review, if you haven't already. ❤️ https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva&ssr=false#review-details
Good idea.
Overall, the Calva experience is just excellent, and to say I am grateful for it would be an understatement. But I would so like to get this one little piece of it to work. 🙏
In VS code clicking on a function redirects to file from resource and bin files, it is painful for me to debug! any idea how to avoid it? i do not want to go to the function which is in resource and bin folder
I early recognize this... @U9A1RLFNV do you recall if we have seen this before?
I seem to remember something about this and it may have been related to clojure-lsp. I don’t remember the solution. @U01J3DB39R6 Is this happening when you have a repl connected?
@UKFSJSM38 Any idea here?
Clojure-lsp ignores target and resources folder by default, check :source-paths-ignore-regex
https://clojure-lsp.io/settings/, if that is not working, check server logs and/or serverInfo
to check the config clojure-lsp is loading and if classpath/source-paths are correct
@U01J3DB39R6 Here’s some info about checking the server logs and the server info: https://calva.io/clojure-lsp/#opening-the-server-log-file https://calva.io/clojure-lsp/#server-info-command
@UKFSJSM38 I do not have those info anywhere mentioned
Which location it will be present? I refereed this https://calva.io/clojure-lsp/#opening-the-server-log-file also I am running figwheel_Server.log
may be I am giving wrong infos, I just installed calva in my vs code and using it, nothing more than that
There is a Calva command Calva Diagnostics: Open Clojure-lsp Log File, when you have issued it, Calva should open the file in a separate editor (tab).
You can also reach this command using the clojure-lsp statusbar button. You'll find the command for showing the lsp server info there as well.
Docs updated. I also created a minimal example project with a README suggesting the terminal-only approach to test that things work: https://github.com/BetterThanTomorrow/calva/tree/published/test-data/projects/minimal-reveal
While waiting you could consider submitting a review, if you haven't already. ❤️ https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva&ssr=false#review-details