This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-24
Channels
- # announcements (5)
- # aws (24)
- # babashka (41)
- # beginners (130)
- # bristol-clojurians (2)
- # calva (39)
- # chlorine-clover (64)
- # cider (30)
- # clojure (202)
- # clojure-belgium (1)
- # clojure-dev (99)
- # clojure-europe (5)
- # clojure-hungary (4)
- # clojure-italy (10)
- # clojure-losangeles (8)
- # clojure-nl (11)
- # clojure-norway (6)
- # clojure-spec (7)
- # clojure-uk (12)
- # clojurescript (52)
- # core-typed (26)
- # cursive (19)
- # data-science (19)
- # datomic (19)
- # duct (10)
- # emacs (17)
- # fulcro (22)
- # graalvm (11)
- # jobs (3)
- # kaocha (28)
- # leiningen (6)
- # lumo (2)
- # malli (10)
- # nrepl (2)
- # off-topic (23)
- # pathom (2)
- # pedestal (7)
- # re-frame (3)
- # reagent (30)
- # reitit (2)
- # remote-jobs (2)
- # shadow-cljs (77)
- # sql (10)
- # test-check (22)
- # tools-deps (37)
- # vscode (1)
- # yada (3)
heya @pez!
have you noticed namespace requires not being highlighted sometimes?
I'm not sure
I think not, I'm pretty sure I saw it happen before
they show up like this
then when I click on the editor
I think I only see this happening when: • I have multiple editors side by side • I am switching between them • I am alt tabbing • I am scrolling up and down
Highlight is quite fokused on the currently active editor. Maybe that is what is (not) going on...
ok, I think I have a more detailed repro now that I write those things down: • open two editors side by side • scroll them down enough that you don't see the requires • alt tab to another window • alt tab back to editor • scroll both editors without clicking them • the one that wasn't active won't have rainbow parens/brackets on sections that were not visible
yes it happens when scrolling without selecting
and not just on require stuff
I think it's everything
then I made the editor active
I don't think this is an important thing, I just thought I'd mention it because I noticed it
Yeah, Calva only does that work on the active editor. An issue would be nice. It's fixable with some amount of work. But also, the issue can help people figure out that we know about it.
here it is
don't even need to alt tab really
best way I can describe it is that the rainbow'ing applies to the visible buffer, not the file.
If I have a long function, and it shows balanced, fine. Then I scroll so that the top 'defn' line goes off the top of the screen, it shows one imbalanced paren (at the end). As I scroll more off the top, it looks like that situation holds
Rainbows are now applied to the visible buffer, yes. But it tries to take enough of the context outside to not be thrown out of balance when forms start above the visible top. Can you repro with some open source code?
I just discovered that yes, in fact, there were unbalanced parens, but waaayy back in the (ns)
OK. Yes, it relies on balance above the rainbowed range, and it is a bit undefined what happens when there is a lack of balance. Can you try this build and see if it handles the situation better or worse for that case you have there? https://4098-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.78-dev-5ea99c55.vsix
Anyway, generally, if I have done things right, a bracket marked as imbalanced should mean that there is something out of balance in the file, above/before the marked bracket. Hopefully close, but in the case of having scrolled a bit down from the actual error it can be quite a bit away.
In the build I just linked to I go some extra mile to not be thrown out of balance. Theoretically it improves 50% of the cases. But the important part is that I think I might have a chance of always knowing where the error originated and thus options to surface that knowledge to the user. It is all still just at the edges of my mental grasp of it, but I can ”sense” this possibility. Hopefully my intuition is founded in something in reality. 😃