calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
bringe 2021-01-24T01:40:19.133400Z

I don't think it's possible currently. I think this may be best done with a new Calva command. Feel free to file an issue for a feature request.

roelof 2021-01-24T10:10:08.133900Z

he, from today I see this error :

roelof 2021-01-24T10:10:27.134500Z

no idea if it's a calva issue

pez 2021-01-24T11:22:04.139100Z

I think it should be solved with those command snippets. We recently pulled a PR that adds some editor variables to those snippets. Sounds like if we add variables for the current form and current top level form, we would handle this case. You think so too, @janne.sauvala ?

pez 2021-01-24T13:25:01.142100Z

Anyone testing out the fix for line-comments should be using this VSIX instead of the one above: https://10367-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.154-971-language-configuration-5e4302e3.vsix And if you have used the one above you should uninstall it. This is because the above one uses a release version number. I’m sorry about that, but Circle CI was down yesterday and I missed a step when building the VSIX locally.

roelof 2021-01-24T13:26:06.142300Z

can happen

2❓
grumplet 2021-01-24T14:02:36.142500Z

Well, in 2.0.134 ^C will allow the terminal to be reused. In clojure-lsp versions, the termnal does not return to a usable state and has to be closed.

grumplet 2021-01-24T14:10:29.142800Z

2.0.134 behaviour was:

^C
Terminal will be reused by tasks, press any key to close it.
Doing so allows the terminal to be reused.

Janne Sauvala 2021-01-24T14:14:28.146900Z

Yes, that could work. I got the idea from Sean Corfield’s setup with vscode+Clover. And your suggestion could be how Clover handles custom command integration with the editor 👍:skin-tone-2:

grumplet 2021-01-24T14:19:44.147100Z

In both I see

clj꞉user꞉> 
; Jack-in done.
clj꞉user꞉> 
; nREPL Connection was closed
in output.calva-repl.

grumplet 2021-01-24T14:20:55.147300Z

The terminal does get reused if there is a fresh jack-in, but is unavailable for command entry.

pez 2021-01-24T14:29:17.147600Z

Sounds like it behaves as intended, but is a bit confusing in how it works and communicates. It is a very limited terminal there. It is a pseudoterminal where I have implemented only the minimal amount of input handling (ctrl+c and that’s it). I probably should mimic that behaviour with closing the terminal on any further input.

agold 2021-01-24T14:47:08.147800Z

Although the link is to a vsix, when I download I get a zip file containing many things but not a vsix. Do I just change the extension to vsix? And by the way, is there any harm to keeping the version I downloaded yesterday, which is working well. It did install as 2.0.154, but I'm not sure what the implications of that are.

pez 2021-01-24T16:08:59.152700Z

I didn't know it would download as a zip, but changing file extension should work. No harm in keeping the one you have other than that I am unsure how it will behave when we release the real 154, which probably will contain other changes. But maybe we will find out soon.

agold 2021-01-24T16:09:46.152900Z

ok, no problem. Thanks again!

2021-01-24T17:06:23.153100Z

This is strange, I just looked on another computer and it's showing option-enter. I don't (yet?) understand the difference between these machines. Will look at it at work tomorrow.

roelof 2021-01-24T18:19:35.153800Z

@pez Did you see my error. It happens when starting up calva

clyfe 2021-01-24T18:43:26.155200Z

> Classpath lookup failed in clojure-lsp. Some features may not work correctly. I started seeing it too; it does not show on all projects. Shows with https://github.com/nextjournal/clojure-mode-demo/ for example

ericdallo 2021-01-24T18:44:55.155300Z

It's related with clojure-lsp , where it failed to lookup the classpath, we had some issues with windows users on this, but it was fixed recently

ericdallo 2021-01-24T18:45:04.155500Z

are you using latest Calva version?

roelof 2021-01-24T18:56:24.155700Z

look like it I have 2.0.153

ericdallo 2021-01-24T19:00:40.155900Z

@brandon.ringe may help us, the issue we fixed it was this one: https://github.com/clojure-lsp/clojure-lsp/issues/237

roelof 2021-01-24T19:05:52.156200Z

oke, I tested it more

roelof 2021-01-24T19:06:10.156400Z

and I see it only on 1 project which uses clokure cli

roelof 2021-01-24T19:06:54.156600Z

the edn file looks like this :

{:source-paths ["src"]

 :dependencies [[binaryage/devtools "0.9.10"]
                [proto-repl "0.3.1"]
                [reagent "0.8.0"]]

 :nrepl        {:port 3333}

 :builds
 {:app {:target :browser
        :output-dir "public/js"
        :asset-path "/js"

        :modules
        {:main
         {:entries [giggin.core]}}

        :devtools
        {:after-load  giggin.core/main
         :http-root   "public"
         :http-port   3000}}}}

roelof 2021-01-24T19:08:38.156900Z

Should I put this project on github so you calva experts can take a look at it

bringe 2021-01-24T19:09:01.157100Z

I guess allowing params would make it way more extensible. Also if it seems many users are using the same custom command, maybe it's a candidate for a built-in command.

ericdallo 2021-01-24T19:10:06.157500Z

Yeah and link it on that issue would be super helpful 🙂

bringe 2021-01-24T19:11:01.157700Z

Another thing that would be really helpful is looking in /tmp/clojure-lsp.out for the error that occurred during classpath lookup. It should contain "classpath" so you can search for that. If you add that to the issue that would be great.

roelof 2021-01-24T19:11:19.158Z

you mean the issue you linked me too

roelof 2021-01-24T19:12:51.158200Z

found the error

java.io.IOException: Cannot run program "shadow-cljs" (in directory "/home/roelof/learn-reagent-course-files/giggin"): error=2, No such file or directory

bringe 2021-01-24T19:13:41.158400Z

Yeah, the CircleCI vsix downloads starting coming down as .zip some time ago, and every time I have to change the file extension to .vsix.

2✅
roelof 2021-01-24T19:14:16.158600Z

wierd. that is package and not a file

bringe 2021-01-24T19:14:47.158800Z

It means you need to install the shadow-cljs command line tool

bringe 2021-01-24T19:15:05.159100Z

See the shadow-cljs docs for how, but I think it's just a global npm package install

bringe 2021-01-24T19:15:27.159300Z

It's trying to run shadow-cljs to get the classpath, but if you don't have it installed, it won't work

bringe 2021-01-24T19:16:33.159500Z

@ericdallo Do you think it would be too verbose to add the error message to the warning message sent from the server? It may save some confusion/questions/time

bringe 2021-01-24T19:17:50.160100Z

Or even a link (can links be placed in those?) to docs explaining where to find the error and how to fix

bringe 2021-01-24T19:18:23.160300Z

Not sure if either are a good idea

ericdallo 2021-01-24T19:19:38.161500Z

links are not supported for all clients so I'd avoid, but if a error message is simple and easy to get, we can add it, but I'd prefer to keep that on clojure-lsp.out and warn user to check that file on the error message, WDYT?

bringe 2021-01-24T19:19:48.161900Z

If you look in /tmp/clojure-lsp.out you can see what the error was when it failed. In some cases it means the command line tool clojure-lsp is using to get the classpath is not installed, so the command is not found, like shadow-cljs

2👍
bringe 2021-01-24T19:20:24.162Z

Yeah, I think pointing them to that would be good for sure

1👍
pez 2021-01-24T19:21:36.162800Z

Have we updated the wiki about this?

bringe 2021-01-24T19:22:55.163Z

I do wonder if the global shadow-cljs is the best way to get the classpath for those projects. Some people may not have it installed but may use npx shadow-cljs or something else. Not sure how else this can be done but if it can be done via clj or lein in conjunction with shadow that might be a more broadly working solution

bringe 2021-01-24T19:23:53.163200Z

Another idea is having fallback options for shadow, but this adds complexity that I'm not sure is a good idea. Like try shadow-cljs - if this fails try npx shadow-cljs etc

bringe 2021-01-24T19:26:25.163400Z

Just did 😃

ericdallo 2021-01-24T19:27:27.163600Z

I see, there are too many ways indeed, it'd be cool if clojure-lsp would be smart to just make it work , and maybe provide an option/flag to specify the shadow-cljs command, then calva could just make a bridge for that settings too

ericdallo 2021-01-24T19:27:41.163800Z

I don't know too much about shadow-cljs though

roelof 2021-01-24T19:30:13.164Z

hmm, I thought it was installed

roelof 2021-01-24T19:30:19.164200Z

but I will do it again

roelof 2021-01-24T19:32:20.164400Z

installed it but the error still appearing

bringe 2021-01-24T19:38:35.164700Z

Hmm yeah an issue and your repro steps would be great

clyfe 2021-01-24T19:54:52.167Z

> " (|)" + backspace = ""; should yield " " (& 2nd backspace to delete the space) A change for calva? Or for my calva-extras?

roelof 2021-01-24T19:58:25.167200Z

moment.repro steps? How do you mean that

pez 2021-01-24T20:02:32.168400Z

There are a few more things in how editing behaves inside strings that we should note down in an issue. Please start it off by creating an issue for this.

roelof 2021-01-24T20:04:50.168500Z

issue made : https://github.com/BetterThanTomorrow/calva/issues/984

bringe 2021-01-24T20:07:20.168800Z

Thanks! I just meant what steps lead up to the error, but what you provided is good

roelof 2021-01-24T20:17:08.169300Z

happy to hear

roelof 2021-01-24T20:17:26.169500Z

hope it can be solved soon

roelof 2021-01-24T20:36:21.169700Z

if you need more info im happy to give

1👍
bringe 2021-01-24T21:28:16.170Z

I just re-read what @pez said and I'm not sure it hit me the first time. That sounds like a great idea. :simple_smile:

1
grumplet 2021-01-24T22:04:44.170400Z

OK thanks - I’ll give the latest another go. I’m very glad to see that those pesky clojure-lsp startup messages seem to have disappeared. At first it felt really clunky having to cancel those in every window for no perceivable benefit over clj-kondo.

grumplet 2021-01-24T22:11:16.174900Z

Any progress on a better workflow for cljs+figwheel-main + webpack jack-in? I did send in a docs PR a while ago explaining my get around for this, but it’s a sub-optimal approach and I think that PR got left behind when you moved the docs github. Those docs are still in https://github.com/gmp26/calva-docs if you want to take another look.

pez 2021-01-24T22:12:57.175100Z

Yeah, it is supposed to give its enhancement without all that shouting. Even if the enhancements are quite huge.

pez 2021-01-24T22:15:17.177200Z

Oh. good that you reminded about it. We will pull in the docs enhancements. Work on the actual jack-in is not really on my schedule right now. But I would welcome an issue about it so that I or someone else can pick it up when we have time and knowledge enough.