BetterThanTomorrow / calva

Clojure & ClojureScript Interactive Programming for VS Code
https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva
Other
1.71k stars 219 forks source link

folding code seems to break rainbow brackets and automatic indentation #1992

Open jamiepratt opened 1 year ago

jamiepratt commented 1 year ago

I'm just beginning to use code folding (with command K + command 0) in visual studio code and I notice that it messes up rainbow brackets and auto indentation.

Screenshot 2022-12-07 at 09 47 19

Screenshot 2022-12-07 at 09 48 00

Calva [Unreleased] [2.0.321] - 2022-12-05

VSCODE Version: 1.73.1 Commit: 6261075646f055b99068d3688932416f2346dd3b Date: 2022-11-09T02:22:48.959Z Electron: 19.0.17 Chromium: 102.0.5005.167 Node.js: 16.14.2 V8: 10.2.154.15-electron.0 OS: Darwin arm64 22.1.0 Sandboxed: No

PEZ commented 1 year ago

Thanks for reporting! I haven't used code folding much, or at all, so haven't noticed.

As a non-user of folding it is unclear to me what in the screenshot I should be looking at and see how wrong it is. 😄 Especially regarding indentation. Please use text examples, because it's hard to copy/paste images to try reproduce errors.

As for rainbow brackets. A workaround might be to disable Calva's rainbows and use the VS Code built in ones. See calva.io for info about this.

jamiepratt commented 1 year ago

Sorry. Try this. Create a new file with this code:

`(ns jamiep.scratch)

(comment "multi line form ")

()`

Fold multiline form with the > in the gutter and the rainbow colours are then wrong.

Screenshot 2022-12-07 at 10 32 53

jamiepratt commented 1 year ago

I can't reproduce the weird indentation thing now I saw earlier but will let you know if I see it again.

jamiepratt commented 1 year ago

I have "calva.highlight.rainbowIndentGuides": true in my settings json and this doesn't fix the issue above.

PEZ commented 1 year ago

I have "calva.highlight.rainbowIndentGuides": true in my settings json and this doesn't fix the issue above.

I meant Calva's brackets, so the setting would be calva.highlight.enableBracketColors. And I meant that that is probably where we have the problem. So you can try disabling them and enable VS Code's built in ones. You might want to disable Calva's indent guides as well, as they match in color with the brackets. And VS Code has built-ins for those too nowadays. More on the link I provided above.

jamiepratt commented 1 year ago

"calva.highlight.enableBracketColors"

Thanks, that works for me!

Jamie