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`.
levitanong 2020-08-11T04:30:00.201900Z

calva + WSL2 also works well for me, except it has some trouble running kondo. I keep getting Couldn't start client clj-kondo šŸ˜ž can anyone help?

pez 2020-08-11T04:40:43.202900Z

That message seems to be coming from the clj-kondo extension. (At least it does not come from Calva, afaict.)

borkdude 2020-08-11T06:48:55.204300Z

@levitanong what do you see in the clj-kondo output window?

levitanong 2020-08-11T07:19:39.205100Z

I have java installed in the WSL2 side, and I am able to run clj-kondo on files there via the command line. I just installed java on the windows side, but I haven't installed clojure on the windows side because I plan to do all my clojure dev in WSL2 I'm not entirely clear on what calls what and where, so could I be misguided? Should I install clojure etc... in the windows side? WSL2 and windows is pretty new to me. šŸ˜…

levitanong 2020-08-11T07:25:28.205300Z

Ah! You were right! I had brew installed java on ubuntu, but for some reason it wasn't in path for some reason. So I just went with sudo apt install. Thanks, and sorry for the noise!

borkdude 2020-08-11T07:34:07.205500Z

So it does work in WSL2?

šŸ‘ 1
borkdude 2020-08-11T07:34:19.205700Z

I'm happy to hear that!

pez 2020-08-11T07:40:12.205900Z

Awesome. If there are learnings here that should go on this page https://calva.io/wsl/ please update it.

levitanong 2020-08-11T06:53:12.204400Z

-- Welcome to clj-kondo v2020.07.29.
--
-- To configure clj-kondo, create a .clj-kondo directory in the root of your workspace and place a config.edn file in it.
-- Check out the configuration documentation here: <https://github.com/borkdude/clj-kondo/blob/master/doc/config.md>.
--
-- If you have questions, join the #clj-kondo channel on Clojurians slack.
-- Report issues at: <https://github.com/borkdude/clj-kondo>.
--
-- Happy linting!

[Error - 2:52:04 PM] Starting client failed
Launching server using command java failed.
I didn't even know this view existed šŸ˜‚

borkdude 2020-08-11T06:53:49.204900Z

Maybe you donā€™t have java installed?

agold 2020-08-11T11:07:37.207Z

I get this message in the output Window: "clj-kondoĀ wasĀ notĀ foundĀ onĀ theĀ classpath.Ā DebuggerĀ decorationsĀ willĀ notĀ beĀ enabled.Ā MoreĀ details:Ā https://calva.io/debugger/#dependencies" But clj-kondo seems to be working just fine, so I ignored it.

pez 2020-08-11T11:09:42.208100Z

Are you using shadow-cljs?

agold 2020-08-11T11:10:16.208300Z

Yes

agold 2020-08-11T11:15:22.208500Z

This should have been in the reply to @levitanong above. It applies to Calva on WSL2.

šŸ˜„ 1
pez 2020-08-11T11:18:09.208700Z

It is a confusing message anyway. šŸ˜ƒ

agold 2020-08-11T11:18:37.208900Z

šŸ‘

levitanong 2020-08-11T11:39:47.209200Z

@agold are you able to use clj-kondo as a CLI in WSL2?

agold 2020-08-11T11:42:18.209400Z

I havenā€™t needed to it, as I use it only for linting in Calva, which works fine. And I havenā€™t used the Calva debugger, so I donā€™t know if the msg about the debugger is meaningful.

pez 2020-08-11T11:43:36.209600Z

There is no debugger for cljs. So the message is not meaningful.

agold 2020-08-11T11:44:13.209800Z

šŸ˜€ Right, I forgot that!

pez 2020-08-11T11:54:03.210Z

kondo is used in two ways currently. The bundled extension, and then an injected version that we use in the debugger to sort out vars and stuff (@brandon.ringe knows more about this). But for users this latter thing is not known, so the message gets interpreted as if there could be problems with lintingā€¦ Weā€™ll fix that message. šŸ˜ƒ

agold 2020-08-11T12:00:51.210200Z

@levitanong: fyi, I just downloaded and installed clj-kondo as instructed on the GitHub page, and it works fine in WSL2.

šŸ‘ 1
agold 2020-08-11T12:14:30.210500Z

Anyway, to @pez and @borkdude, a million thanks. Calva and clj-kondo make developing cljs a pleasure, and Calva just keeps getting better. I used Emacs/Cider for many years and loved both, but my .emacs file was getting to the point where I was afraid that the whole contraption might fall apart with the next update. VSCode just feels like a more solid base.

pez 2020-08-11T12:25:19.210700Z

Sweet. Thanks for letting us know! And since you are a WSL2 user, I think that answers @borkdudeā€™s question very nicely from a perspective of someone who would love a Calva shoutout. ā¤ļø

borkdude 2020-08-11T12:27:11.210900Z

<3

agold 2020-08-11T12:29:57.211100Z

I actually use Calva not only on WSL2 but also Mac and straight-up Linux and have found it quite trouble-free on all 3 platforms. Another plus for me is that it is much less painful to keep my VSCode settings in sync across platforms than it was with Emacs, where there were more platform-specific gotchas. My only gripe is that some of the paredit keybindings don't work properly on the Mac, but at the moment I can't remember which ones. I'll file an issue when I go back to working on the Mac. Right now I'm mainly on WSL2 (for the past week or so) and so far no issues at all.

pez 2020-08-11T12:31:59.211300Z

Itā€™s not these shortcuts? https://calva.io/quirks/#macos-and-the-slurp-and-barf-keyboard-shortcuts

agold 2020-08-11T12:35:11.211600Z

No. My memory is vague, but I think it may have been the splice-and-kill-backwards/forwards commands. Not quite sure. In any case, no big deal, and it may be my screwup. Will file an issue if needed when I have time.

agold 2020-08-11T12:38:29.211800Z

Possibly relevant: I'm using a Mac laptop , where the Delete key is actually Backspace and there is no actual Delete key (fn-Delete gives you delete), so commands that are listed in Calva kb shortcuts as using Delete don't work as advertised. If I recall correctly.

pez 2020-08-11T12:42:23.212Z

Hmmm, they do on my MacBook. (I use fn-backspace to produce delete, as you say there.)

agold 2020-08-11T12:43:52.212200Z

I will try again. Seems to require some manual dexterity to do alt-shift-fn-delete or whatever chord is required for some commands.

pez 2020-08-11T12:55:52.212400Z

Oh, yes. The shortcuts could be much improved. Iā€™ve been stubborn in trying to keep he default ones cross plattform, but the price is too high.

šŸ™‚ 1
bringe 2020-08-11T16:18:00.213100Z

Ah yes, a bad decision of mine to print that error, in retrospect. I'll create an issue and remove it soon, and instead let the docs do the talking in that respect. I've seen multiple questions about it at this point (confusion).

bringe 2020-08-11T16:19:06.213300Z

My reasoning was that if clj-kondo is not on the classpath then debugger decorations will not work (highlighting instrumented functions) and the user may be confused / think it's broken, but since this isn't a super widely used feature, and it's only for clj, it makes sense not to bark about it in the output.

pez 2020-08-11T16:25:45.213600Z

Is there a way we could bundle clj-kondo the command, and use it that way? Then everyone gets debugging even if they do not provide the deps in their projects.

borkdude 2020-08-11T16:26:32.213800Z

"The command" as in "the binary" is not needed with VSCode, it's all Java, LSP server remember

pez 2020-08-11T16:27:45.214100Z

Yeah, the command as in java ... šŸ˜ƒ . The way the clj-kondo extension does it.

borkdude 2020-08-11T16:28:16.214300Z

oh right

pez 2020-08-11T16:28:54.214500Z

Or if you add an api to the extension, Calva already depends on it.

bringe 2020-08-11T16:29:50.214700Z

I vaguely remember @borkdude suggesting the JVM lib was the better option for my use-case, but maybe I'm mistaken, and I don't remember the reasoning besides maybe performance? It's called fairly often, but then again does the clj-kondo extension perform linting this way? I'd love to remove that dep injection in the jack-in and have it behave the same if possible

bringe 2020-08-11T16:30:12.214900Z

Oh also, I needed the lint analysis

bringe 2020-08-11T16:30:16.215100Z

need*

borkdude 2020-08-11T16:30:24.215300Z

@brandon.ringe clj-kondo in VSCode starts an LSP server. This is only started once per workspace

borkdude 2020-08-11T16:30:58.215500Z

So only one JVM per VSCode window mostly

bringe 2020-08-11T16:32:36.215700Z

I see. So here is my use case

const code = `(with-in-str ${JSON.stringify(documentText)} (:analysis (clj-kondo.core/run! {:lint ["-"] :lang :clj :config {:output {:analysis true}}})))`;
I need that lint analysis - and iirc I couldn't get that without calling kondo via clojure, and the only way I saw that I could do that was through the connected repl, which needs kondo on its classpath.

bringe 2020-08-11T16:32:44.215900Z

Is there another way?

borkdude 2020-08-11T16:36:42.216100Z

doing it via the REPL is convenient, for startup

borkdude 2020-08-11T16:37:03.216300Z

if there is no REPL, you could maybe start one yourself?

borkdude 2020-08-11T16:40:15.216500Z

Or maybe you can adopt the LSP server model from the clj-kondo plugin

borkdude 2020-08-11T16:40:29.216700Z

but for Calva purposes

bringe 2020-08-11T16:43:44.216900Z

Yeah, starting a new repl is another option, but it's used for something that only makes sense when a repl is connected, so I just used the one started by the jack-in process. Starting another repl completely seems a bit heavy-handed, as I imagine another terminal/pseudoterminal would be necessary and might confuse the user. I don't want to depend on the plugin, in case someone disables/uninstalls it (don't want this feature to break). Maybe that is not what you are suggesting.

bringe 2020-08-11T16:43:59.217100Z

I've also wondered if clojure-lsp can provide me with what I need, but integrating that is still on the todo list

pez 2020-08-11T17:07:30.217300Z

The user can't disable uninstall clj-kondo w/o first disabling Calva.

pez 2020-08-11T17:08:10.217500Z

This is a mistake in the current Calva conf, but you could depend on it and then we don't need to fix the mistake. šŸ˜ƒ

pez 2020-08-11T17:09:00.217700Z

I don't know when that dependency was added, actually. It is quite odd.

borkdude 2020-08-11T17:37:12.217900Z

@brandon.ringe No, that wasn't what I was suggesting. My suggestion was to copy what clj-kondo is doing running as an LSP server, but it its output for Calva

borkdude 2020-08-11T17:37:26.218100Z

So not depending, but forking the plugin code

borkdude 2020-08-11T17:37:46.218400Z

This will mean an extra JVM as well

borkdude 2020-08-11T17:37:55.218600Z

so, I'll leave those trade offs up to you

bringe 2020-08-11T17:59:36.218800Z

Ah I see. Thanks for the info. We can ponder this, but for a single call, I think what we have works fine for now. Just need to remove the confusing message.

pez 2020-08-11T18:44:50.220300Z

The message is actually what you need if you don't use jack-in, right?

bringe 2020-08-11T19:49:40.220500Z

The message displays if, on repl connect, clj-kondo is not found on the classpath (really the code requires it, and if error, displays that message). So not just about jack-in, if the user connected to some repl started without jack-in that has clj-kondo as a dep, then decorations would work and that message would not show