This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-10
Channels
- # asami (41)
- # babashka (24)
- # beginners (48)
- # calva (41)
- # cider (10)
- # clj-commons (20)
- # clj-kondo (2)
- # cljdoc (8)
- # clojure (131)
- # clojure-australia (4)
- # clojure-europe (17)
- # clojure-hungary (2)
- # clojure-india (2)
- # clojure-nl (3)
- # clojure-uk (1)
- # clojurescript (12)
- # community-development (6)
- # core-logic (4)
- # cursive (11)
- # datomic (22)
- # emacs (25)
- # events (1)
- # exercism (2)
- # fulcro (30)
- # helix (5)
- # honeysql (6)
- # hugsql (3)
- # integrant (12)
- # introduce-yourself (4)
- # lsp (5)
- # malli (5)
- # nextjournal (31)
- # off-topic (4)
- # pedestal (3)
- # portal (51)
- # reitit (33)
- # remote-jobs (1)
- # shadow-cljs (12)
- # sql (10)
- # vim (7)
- # xtdb (37)
IMPORTANT: Dear Calva friends. It seems the latest Calva (v2.0.224) is causing problems on Windows (or at least for a Windows user, and I can’t repro on my Mac). Symptoms are that entering parens inputs strange stuff. The previous version works.
I can’t reproduce on my Windows machine either. If someone experiences problems with 224, please let me know and maybe we can find the issue together. 🙏
Version v2.0.225 is released now. It’s v2.0.223 with a new name. Now, how do I fix a bug that I can’t reproduce?
224 works fine for me on windows too. I can enter [
,`(` and {
without any strange occurrences in paredit strict mode.
> Now, how do I fix a bug that I can’t reproduce? GOod luck, I hate these sort of bugs!
I wasn't, I was using LF.
Switching to CRLF triggers it though, for me at least.
Now when I enter (
, I briefly get ()
, which then changes to li
and sometimes ge
Only in certain files though, I have one .clj file with a bunch of functions. That triggers it. I created a blank file with just a namespace declaration, switch to CRLF, and it behaves as it should
So, you have this problem, @qmstuart. Congratulations! 😄 Now you can help debug it, until I can recreate it.
Oh man this is going to be a nightmare for you, i have 4 files in this project and it only happens in one of them 😄
For some reason each CR in the file causes a character offset in the editing. If you have 3 lines in front of the cursor, and enter a (
, then a character 3 positions forwards from the cursor will be inserted. Twice, even, in front of and after the cursor. I could maybe release it as a palindrome extension.
If you really don’t have the issue in all four files when they are in CRLF mode, then that could be a major clue.
Thanks! Nice music! The problem is there in all the files. You just need to edit them “high” up enough so that there are characters left below for the bug to pick from..
Hey folks 👋 Question! Does Calva also bake in paredit-like editing for HTML tags 🏷️? Alternatively, does anyone know of a VS Code plugin that allows for paredit-like HTML editing (like https://github.com/magnars/tagedit for Emacs) 😅?
That’s a dream I have! Calva’s Paredit can, in theory, be generalized to do this, but it would be quite some work.
Dear Calva friends. As stated ^above^, v2.0.224 had problems in store for some Windows users. See also https://github.com/BetterThanTomorrow/calva/issues/1379. Afaik, it only affects a new method for autoclosing brackets, which was enabled by default in 224 and made impossible to code for the users where it didn’t work. Here’s a new build (a release build of v2.0.226, which disables this new auto-close by default, and re-enables the old method (letting VS Code handle it). Now I need help testing 226: 1. Used with its defaults (Parinfer and Format Forward off) it should work without troubles. 2. Used with Parinfer and Format Forward on, it should deliver the experimental features (mostly trouble free) 3. Used with the new auto-closing it will keep causing problems in CRLF files, under some unknown circumstances. 226 can therefore be used to help figure out a way for me to reproduce the problem. (Which I can’t yet.) So please: • Download and install https://15952-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.226-dev-ec9f3fcb.vsix • Read the https://github.com/BetterThanTomorrow/calva/blob/dev/docs/site/parinfer.md (Github doesn’t render it very well, but anyway) To test that it doesn’t cause problems run it without changing any Calva settings. To test the experimental features, use these settings:
"calva.fmt.formatForward": true,
"calva.fmt.inferParensAsYouType": true,
"[clojure]": {
"editor.autoClosingBrackets": "never",
}
To try provoke the problem, edit files in CRLF mode and have these setting:
"calva.paredit.strictPreventUnmatchedClosingBracket": true,
"calva.paredit.strictAutoClosingBrackets": true,
"calva.fmt.formatForward": false,
"calva.fmt.inferParensAsYouType": false,
"[clojure]": {
"editor.autoClosingBrackets": "never",
}
UPDATE: There’s a new VSIX linked here, with an attempt at a fix. It would be super if @qmstuart and others who could reproduce the problem checked.@U064X3EF3 If you mention these problems in the Deref, I’d be super grateful! I have too few clues to fix it, and I am also worried that something is fundamentally wrong down in super important Calva infrastructure. With some more eyes and brains on it, hopefully we can have it fixed soon. Parinfer is a big deal for a lot of users, so it is newsworthy for that reason as well.
I updated the issue with some of the same text as above: https://github.com/BetterThanTomorrow/calva/issues/1379
It seems we still have problems of a similar nature with the latest 226 build. Paredit delete to end of list exposes it for a user.
Oh my I just tried the parinfer experiment, this is going to make me SOOOOO happy!!!!!!!!!!!!!! 🙂
@U0ETXRFEW Can’t you just put the experimental stuff in the normal release? Since you need to enable it manually anyway, and it clearly states “experimental”… That would make it so much easier to test! 🙂
I did it that way first, actually. That was v2.0.224. See the issue linked. And even if 226 is slightly better it also causes issues even with the features disabled.
What you can do, and tell anyone you want to test this is that they can tell VS Code to use v2.0.224 of Calva. It doesn’t cause those super bad issues for everyone.
It lacks some fixes that 226 has of course. But anyway, for general feel of the parinfer+format-forward it should do fine.
I updated the issue with some of the same text as above: https://github.com/BetterThanTomorrow/calva/issues/1379
hello, calva newbie question here. how do i start calva so that it has custom environment variables?
Calva will just inherit whatever environment variables VS Code has. Do you mean how to start the REPL with custom environment variables? If you are using Jack-in, there is a jackInEnv
setting for that.
There is a “global” calva.jackInEnv
, and you can also add a jackInEnv
in custom connect sequences. They will be merged.
There is also a mechanism for using environment variables in the jackInEnv
definition. Let me see if I can find somewhere this has been written down…
Here is the only place I find right now: https://github.com/BetterThanTomorrow/calva/issues/933 I’m sorry, this is a glitch in the docs. I have reopened an issue about this: https://github.com/BetterThanTomorrow/calva/issues/1170