Fork me on GitHub
#calva
<
2021-11-10
>
pez12:11:44

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.

pez12:11:34

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. 🙏

pez13:11:25

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?

Stuart15:11:02

224 works fine for me on windows too. I can enter [,`(` and { without any strange occurrences in paredit strict mode.

Stuart15:11:46

> Now, how do I fix a bug that I can’t reproduce? GOod luck, I hate these sort of bugs!

pez15:11:37

@qmstuart are you editing the files using CRLF as line endings?

Stuart15:11:55

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

Stuart15:11:33

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

Stuart15:11:47

Albeit it with strange red highlighting on certain bits of the file

pez15:11:31

Those highlighting might go away if you close the file and open it again.

Stuart15:11:20

I think the behavior also depends on where in the file the cursor is

pez15:11:31

So, you have this problem, @qmstuart. Congratulations! 😄 Now you can help debug it, until I can recreate it.

Stuart15:11:39

if I try to put a paren at end of file, it briefly flashes up () then deletes both!

Stuart15:11:26

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 😄

pez15:11:33

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.

pez15:11:32

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.

pez16:11:59

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..

sansarip16:11:24

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) 😅?

👋 1
pez16:11:52

That’s a dream I have! Calva’s Paredit can, in theory, be generalized to do this, but it would be quite some work.

sansarip16:11:27

Thanks! Good to know 😄

pez16:11:31

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.

👍 1
1
pez16:11:12

@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. gratitude Parinfer is a big deal for a lot of users, so it is newsworthy for that reason as well.

pez11:11:22

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.

Stefan10:11:36

Oh my I just tried the parinfer experiment, this is going to make me SOOOOO happy!!!!!!!!!!!!!! 🙂

❤️ 1
Stefan12:11:39

@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! 🙂

pez12:11:28

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.

Stefan12:11:02

Oh right that makes sense, too bad though 😉

pez12:11:42

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.

pez12:11:36

Not even all CRLF Windows users. (I can’t repro it myself, unfortunately) .

Stefan12:11:02

Cool, will do!

pez13:11:17

It lacks some fixes that 226 has of course. But anyway, for general feel of the parinfer+format-forward it should do fine.

pez16:11:35
replied to a thread: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.

I updated the issue with some of the same text as above: https://github.com/BetterThanTomorrow/calva/issues/1379

jmv21:11:51

hello, calva newbie question here. how do i start calva so that it has custom environment variables?

pez22:11:37

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.

jmv22:11:38

thanks for the info. where does the jackInEnv go?

jmv22:11:47

nvm, found it. thank you!

pez22:11:05

I think maybe it is not documented at all…

pez22:11:53

There is a “global” calva.jackInEnv, and you can also add a jackInEnv in custom connect sequences. They will be merged.

pez22:11:58

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…

pez22:11:49

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