This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-05
Channels
- # announcements (10)
- # beginners (59)
- # calva (172)
- # cider (13)
- # clj-kondo (1)
- # cljdoc (10)
- # cljs-dev (4)
- # cljsrn (65)
- # clojure (144)
- # clojure-europe (2)
- # clojure-italy (26)
- # clojure-losangeles (1)
- # clojure-nl (14)
- # clojure-spec (26)
- # clojure-uk (91)
- # clojurescript (75)
- # core-async (53)
- # cursive (11)
- # datomic (16)
- # fulcro (42)
- # graalvm (29)
- # graphql (9)
- # kaocha (3)
- # leiningen (22)
- # off-topic (26)
- # qa (1)
- # re-frame (3)
- # reagent (7)
- # reitit (10)
- # rewrite-clj (56)
- # robots (1)
- # shadow-cljs (107)
- # spacemacs (10)
- # specter (5)
- # sql (15)
- # tools-deps (39)
- # vim (11)
Re the CLJS/TS thingy. If I had time to contribute, I would probably be more likely to contribute to something CLJS rather than something TS. I’m fighting TS enough as it is at work.
Having said that, I see value in trying to make some architectural decision around this. It might make sense to implement whatever is Clojure specific in CLJS, and use TS for the stuff that’s VSCode specific.
To elaborate. A lot of what is Orchard today was first implemented in Emacslisp, but has later been rewritten in Clojure.
So that could also be used as a guide. Stuff that could be useful for the broader Clojure community should probably be implemented in Clojure.
I was more determined to push all ”business logic” into cljs and only keep vscode integration stuff in TS before, but lately I've been seeing other lines along which things can be divided. There is definitely a use for cljs to bring in Clojure libraries.
> So that could also be used as a guide. Stuff that could be useful for the broader Clojure community should probably be implemented in Clojure. This can also point us in the direction of TS, depending on what it is we're building. Like with the repl-indicator: https://github.com/BetterThanTomorrow/repl-interactor#why-typescript
I am considering making today the release day of Calva 2. Here's the build that would be released if so: https://github.com/BetterThanTomorrow/calva/blob/dev/alpha-build/clojure4vscode-2.0.0-SNAPSHOT.vsix I find it much easier to use and more productive than the current marketplace version, which sort of speaks for release, right? There will be new bugs and stuff, of course, but it seems the fastest way to get to know about those is to publish the new version.
Has someone ran into the following issue: sometimes VS Code blocks the standard input of new terminal windows:
Could that be related to Calva? Even if I exit the repl, the problem persists and I need to fully restart VS Code, so this hints, that it’s more of a VS Code issue, than Calva, but I just wonder if anyone else has had this problem before.
@sasho.popov, yes, there are issues reported on the Calva repo about this. I have never experienced it though, despite crystal clear reproduction steps. It is one of the reasons why Calva 2 does not use the integrated terminals for the repls. (Not that I know if Calva 2 will improve on this issue, but staying away from terminals seem like a good idea, anyway.)
But that’s the strange thing - I’m also not using the integrated terminal. I start a repl in iTerm2, then go to VS Code and click the connect button, which opens a dialog with localhost:12345 with the correct port already pre-filled. That’s how I connect to the repl.
I don’t know about Calva 2, but I’m keen on testing this out. The thing is, I don’t know how to reproduce the problem.
I'll release today if I find a time slot big enough. Unless some new information drops in that speaks against it.
O.K., so are there anywhere instructions how to use the unreleased version? I mean this: https://github.com/BetterThanTomorrow/calva/blob/dev/alpha-build/clojure4vscode-2.0.0-SNAPSHOT.vsix
Which readme are you referring to, this one? https://github.com/BetterThanTomorrow/calva/blob/dev/README.md
Do I first need to uninstall the currently installed version of Calva from the Marketplace?
O.K., so now I cannot connect to a sunning repl :thinking_face:: > Hooking up nREPL sessions... > Connected session: clj > Failed connecting. (Calva needs a REPL started before it can connect.) Will try jack-in now…
WOW, the new syntax highlighting is so cool - I especially like the different braces colors… 🙂
Steps:
1. Go to iTerm to and run lein repl
. Wait for the repl to start.
2. Go to VS Code and click on nREPL at the bottom.
3. Enter localhost:12345
Yes, Calva 1 could connect to the repl.
try to do it like in the wiki described https://github.com/BetterThanTomorrow/calva/wiki
So, was that connect or jack-in? Guessing connect, since there would have been a picker for project type otherwise.
Cool. Probably your project has the dependencies configured. You won't need that if you use jack-in.
Yeah, jack-in seems to be more convenient, since I wouldn’t need to start a separate repl manually in iTerm2, right?
What I do if I want to have the project running and connect to it is that I first do jack-in, and copy the command line. Then run that outside Calva and then connect.
Hm, strange thing is happening. I restart VS code and now the Calva icon at the bottom (nREPL) does not appear. When I try to start Jack in or connect from the command palette, I get command not found:
I think so. I have been trying to fix it so that it is not necessary, but I don't think I am there yet.
Also, if you feel in the helping mode. It could be something for a troubleshooting page on the wiki.
I published it as a new extension. Making the upgrade sort of optional for now. I've added some checks for in the old and new extensions so that they warn the user about not having both installed. Tonight I'll rename the old extension to Calva Legacy.
Hey, @pez, in Calva 2, is it possible to run a single test. I’m in a file with multiple tests, but I want to run only one of them.
Not at the moment, no. I think it might be posted as a feature request, if not, please do. 😃
Friends of Calva, a Request for your kind assistance. In releasing Calva 2 as a new extension I lost the 11 five-star, and kindly formulated, reviews the old one has. Please, pretty please, consider reviewing the new entry on the marketplace, to help people choose the right extension for their Clojure work: https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva&ssr=false#review-details
Dear devs, with the recent releasing release we are also back on master
. (And the legacy version is forked of to a new repository, hopefully enjoying its final rest.)
Oh, and the reason I forked out the legacy version is that vscode embeds the readme from the repo root. So for anyone using that version it would be confusion with the new readme.
I just assumed something was radically different to warrant two apps in VS Code’s marketplace and two repos.
I'm trying things out... I see the jack-in functionality supports figwheel and shadow out of the box. Can it setup a vanilla cljs repl too? Or does that require launching externally and connecting to the server?
What is a vanilla cljs repl? But, whatever it is, you probably will not be able to get Calva to start it for you.
sorry, the repl described here https://clojurescript.org/guides/quick-start I think that's sometimes called the "vanilla" or bare bones repl.
oh, I wonder if that's non-trivial, given the nrepl stuff... You'd probably end up rebuilding some of the figwheel/shadow functionality, to make the default repl "jack-in"
Hey @yogthos, for Calva 2 to work, it has to have at least one Clojure file open. Do this: - open a project, but don’t open any files - Calva 2 will not work (if you try to connect via the Command Palette, you’ll get this error) - Now open a clj file - Calva 2 should be working now
Honestly, the only thing keeping me on atom is the parinfer implementation on the atom plugin I use is so fluid for me now that it's hard to give it up
I can cut and paste large sections of code without worrying about lining parens. Just highlight entire rows of text, cut, paste, parinfer fixes everything
So hopefully these plugins will allow some par* customization/plugability in the future, as a lot of devs seem to have different habits there.
here are the keybindings I'm using https://github.com/yogthos/configs/blob/master/vscodium/keybindings.json
@bozhidar: two versions is temporary. I mainly used this opportunity to fix some original bad naming choices. But, yeah, I am a bit defensive with the new version as well, as it could have some yet uncovered bugs that stop people from getting their work done. Let’s hope not, and I can remove the legacy version soon.
@john: I use barf/slurp all the time. Default key bindings for them are ctrl+left
and ctrl-right
to make them easy to reach and to remember. I also use expand/shrink, like @yogthos suggests. I wish vscode made a proper parinfer possible, but, so far, no-one who set out on that journey ever returned. Calva has a command Infer parens, ctrl+alt+p
that often saves my day.
I think so. What could happen is that something else in the OS has booked it, but I don’t think that is the case on the OS level. Rather it is some other app, and hopefully it is configurable so that people can keep using the easy shortcuts for barf/slurp.
@pez just trying the latest vsix from the project repository (sorry, later than I said I would). Wow. it looks great. I've tried it with the classic ClojureBridge project and it just works. This is so awesome. I am also trying out all the exercises and some of the features to see if I find any bugs. I am using a clean install of VS Code (on a new laptop) so will let you know if I find any issues.
Wonderful to hear @jr0cket! Please try it with the freshly released version from the Marketplace. (it’s pretty much identical with the one from the repo, but anyway.
trying calva and vscode, and nothing works — trying to run any calva command results in popup "command 'calva.%commandname%' not found"
When you open a given project, make sure at least 1 Clojure file is open. Does the problem remain?
maybe there is an exception somewhere? I'm new to vscode, don't know how to find what's wrong
I updated vscode to latest version, uninstalled old calva and installed new one. Did many restarts. not helping..
Activating extension 'betterthantomorrow.calva' failed: Cannot read property 'languageId' of null.
found the stack trace:
Here is the error stack: TypeError: Cannot read property 'languageId' of null
at addDocument (/home/vlaaad/.vscode/extensions/betterthantomorrow.calva-2.0.2/out/calva-fmt/ts/docmirror/index.js:44:13)
at Object.activate (/home/vlaaad/.vscode/extensions/betterthantomorrow.calva-2.0.2/out/calva-fmt/ts/docmirror/index.js:62:5)
at Object.activate (/home/vlaaad/.vscode/extensions/betterthantomorrow.calva-2.0.2/out/calva-fmt/ts/extension.js:23:15)
at activate (/home/vlaaad/.vscode/extensions/betterthantomorrow.calva-2.0.2/out/extension.js:61:13)
at Function._callActivateOptional (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:738:936)
at Function._callActivate (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:738:625)
at define._doActivateExtension.Promise.all.then.e (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:737:635)
It’s haunting me still this bug. Can’t believe it almost. But I’ll bring my garlic and crucifixes this time.
Hello. Have a small question about the new clj repl. Are results supposed to be pretty printed automatically? Mine appear to not be.
Note that my jack-in on windows is not currently working (made a note on a related issue in github). So actually, maybe I need to add the dependencies.
@brandon.ringe pretty printing is broken, unfortunately. We need to fix it! https://github.com/BetterThanTomorrow/calva/issues/179
As for your jack-in, if you copy the command that Calva uses in the Calva Jack-in task and replace the unquoted double quotes with single quotes and execute it. Does it then work to connect to that repl?
I have a very old mac with only 8G ram and it chokes when I start Win 10 in Virtual Box. It makes this really hard to fix for me. If you have the dev environment set up maybe we can work at it together?
(And powershell feels as ancient as it did when I tried it back then many years ago. But that’s another issue. 😃 )
This may be a silly question but how do I get the exact command that the task is running?
It’s in the terminals pane. There’s a dropdown menu there. (You need to issue the jack-in command for it to appear, though.)
If that works, we at least have a workaround to add to the issue and to the wiki until the issue is fixed.
OH, :man-facepalming: Was thinking it was being cut off, but it's the whole command I see
I mean, it does still ask me to input the nrepl port, but I think the task would handle that if it worked through the task right?
Can you updated the issue with the workaround, @brandon.ringe? I need to catch some sleep now.