Fork me on GitHub
#calva
<
2023-03-18
>
pez08:03:43

The Clojure Survey is closed now. I'm super curious about what it will say about Calva usage. From my perspective, judging mostly from the increased amount of traffic in this channel and on the Github repo, but also from observations out in the wild, it looks like quite a few people have switched to Calva. Granted, I have increased some of the support traffic myself, by shipping bugs, but anyway. 😃

😂 6
seancorfield19:03:25

I'm sure that Calva is gaining user share 😁I think the really interesting thing will be finding out where it is taking share from... I'm going to guess from IntelliJ/Cursive. It's not a zero-sum game, of course, the "pie" is growing...

pez19:03:18

One data point is that Calva Spritz already has almost 3000 installs.

hoppy02:03:30

you gained at least one tough holdout, to be sure.

❤️ 2
pez12:03:37

I hope a growing pie is most of it. But there's churn in IntelliJ, things stop to work that worked just fine and after some hits of that, people start to consider the alternatives.

pez08:03:22

Dear Calva friends. https://github.com/BetterThanTomorrow/calva/releases/tag/v2.0.340 • Workaround: https://github.com/BetterThanTomorrow/calva/issues/1850 In which we temporarily move the Clojure file associations -> Notebooks out of the Calva extension and into a separate extension, https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva-spritz. This is because the notebooks file associations interfere with LiveShare sessions (due to a LiveShare bug). Now you can disable and enable Calva Spritz at will, no reload necessary. Try right-clicking a Clojure file and choose Reopen Editor With... and you should see Clojure Notebook in the list. Now disable Calva Spritz and try again. (It is yet to be confirmed that it really helps for the LiveShare bug, but I have good hopes it does.)

pez10:03:07

Oh, and please feel encouraged to throw a rating of love onto that extension. While at it, if you haven't filed a review on Calva yet... 😃 ❤️ calva

Stefan11:03:41

This was a very good idea that you came up yesterday when we talked @U0ETXRFEW, and now you already implemented it! I'm super happy with this. Next week I will test live share with my colleagues again, to see whether there are any live-share related Calva issues remaining and hopefully also address them. 🎉 Thanks a lot Peter!!! calva

🙏 2
pez11:03:11

And I only came up with the idea because I misunderstood something you said. 😃 Let's hope it actually solves the problem!

pez11:03:35

Anyone want to try the LiveShare thing together with me? I'm opening a huddle in the channel and we can throw a Saturday Calva Spritz party. calva :bubbles: 🍾

Alejandro Buffery14:03:19

I use the vim extension in vscode. Doing the calva paredit tutorial i have seen what “strict mode” does, but when i do the typical vim ‘x’ to delete a character it does delete the paren. Is there a “stricter mode” for vim user, or a hack i can use ? Thanksss

pez14:03:41

I think you'll need to remap x to paredit forward delete somehow. Not a VIM user here so don't know how it works... Maybe https://calva.io/vim/ can offer some starting point. (If not, we should fix that.)

Alejandro Buffery15:03:08

I have got it working by remapping, but I have not been able to make it aware of the file type, so that ‘x’ still works with other languages, filetypes. According to this https://code.visualstudio.com/docs/languages/identifiers clojure is not identified. The setting i am using is : { “before”: [“x”], “commands”: [ { “command”: “paredit.deleteForward” } ], “when”: “editorLangId == clojure”, } but the ‘when’ is not working

pez15:03:46

If it is the same when clauses as with regular vscode, you could try copying the when clause for Calva’s default keybinding and try that.

pez16:03:30

Hmmm, no, Calva also does editorLangId == clojure. Very strange that it is not defined. Calva code relies on it all over.

Alejandro Buffery17:03:31

Thanksss Peterr !!!

pez11:03:11

We both read that list sloppily, @U04T3JCE9GX. Clojure is there. 😃 I think it is that when clauses are not available when defining VIM keybindings. You might get away with something like this, though, in the vscode regular keybindings file:

{
        "key": "x",
        "command": "paredit.deleteForward",
        "when": "editorTextFocus && editorLangId == clojure && vim.active && vim.mode == 'Normal' && !inDebugRepl && !suggestWidgetVisible && !renameInputVisible && !findInputFocussed && !replaceInputFocussed && !isInEmbeddedEditor && !hasOtherSuggestions && !hasSnippetCompletions && !hasMultipleSelections && !hasNonEmptySelection && !editorReadonly"
    },

Alejandro Buffery11:03:12

Thankssss, I’ll have a go. Yes, I have seen it is there now.

Alejandro Buffery11:03:25

I would bet it was not before

Alejandro Buffery11:03:48

Its hard for me to believe we both missed it

pez11:03:06

Maybe they put it there and we are gaslighted? 😃

Alejandro Buffery12:03:53

just rechecking clojureverse is smarter than chatGPT 😜

Alejandro Buffery12:03:01

I have just tested your regular keybinding, and it workssss 👍 Thanksss

metal 2
pez19:03:50

It was a joint effort between ChatGPT and Copilot mostly. 😃

pez14:03:00

Dear Calva friends. Lately I have been lacking a way to quickly convert HTML to Hiccup. I want it to support both regular Hiccup and the Reagent variant. If someone feels like implementing the actual converter in the ClojureScript part of Calva, I can do the gluing into VS Code. Does that sound like fun, you think? Then please file a PR on Calva, implementing the converter and some unit tests for it. Here's an issue you can reference in a commit: • https://github.com/BetterThanTomorrow/calva/issues/407 See https://github.com/BetterThanTomorrow/calva/wiki/Run-Calva-in-Development-Mode to get started.

Alejandro Buffery14:03:14

I saw a video today that cursive does that, I do not know, use cursive, but just in case that functionality code can be copied, reused

pez15:03:08

Cursive is not open source, I think. Besides, it would spoil the postwalk fun. 😀

skylize20:03:31

No idea what issues Reagent introduces or if this lib is any good to begin with. But have you considered https://github.com/green-coder/html-to-hiccup ? I'd say 44 GitHub stars sounds promising enough to be worth taking a look. The codebase is tiny, but depends on InstaParse. Not sure how much weight InstaParse brings in.

pez20:03:07

Worth taking a look at. Even if we don’t have the requirement that it should be cross platform. We could use parse-html from npm and do a postwalk on that AST.

pez14:03:39

No takers. 😃 Well, I came up with this: • html->hiccup: https://github.com/BetterThanTomorrow/calva/blob/407-html-to-hiccup/src/cljs-lib/src/calva/html2hiccup.cljs • tests: https://github.com/BetterThanTomorrow/calva/blob/407-html-to-hiccup/src/cljs-lib/test/calva/html2hiccup_test.cljs WIP. But it is pretty complete like this. Minus Reagent special things, which I might or might not add before releasing V1 of this feature.

pez09:03:13

Dear Calva friends: Please help test a feature we are about to release: conversion of HTML to Hiccup. Both from a selection and from the clipboard..Docs are pending, but the PR has some more context. • More info at the PR: https://github.com/BetterThanTomorrow/calva/pull/2124 • VSIX: https://output.circle-artifacts.com/output/job/c3f47e50-42ca-4a72-866b-41c369b606c2/artifacts/0/tmp/artifacts/calva-2.0.341-407-html-to-hiccup-6825bcd5.vsix