Dear Calva friends: https://github.com/BetterThanTomorrow/calva/releases/tag/v2.0.535 • https://github.com/BetterThanTomorrow/calva/issues/2942 • https://github.com/BetterThanTomorrow/calva/issues/2940 ◦ This one’s for you, @giovanni968 😃 See https://calva.io/when-clauses/ for a usage example • Bump deps.clj.jar to v1.12.3.1577 The API evaluation output update will benefit Backseat Driver users who want to follow what the AI is evaluating and the results it gets. When I asked Claude Sonnet 4 to test the update, it went a bit creative with using ANSI terminal sequences. Haha.
Copilot also showed me that the terminal output supports animating things 😃
I didnt know about the conditional clauses. Looks very powerful system! https://code.visualstudio.com/api/references/when-clause-contexts Since I am invoking a lot of commands from voice, via rpc. I was looking for a way to use this system, without necessarily invoking a keyboard shortcut or menu item. Just straight from a command. It seems it is not possible, because “when clauses” are a private dsl for the the hotkeys and menu-manager module, mostly to govern contextual availability of the command, not change the dispatch on the command itself when it runs. But is seems it is trivial to just do whatever logic and context sourcing I would want directly in joyride! joyride 🤩 AI recommended building a custom json logic evaluator for this case. But I would prefer looking at clojure instead of json anyway. So with joyride I can skip the json logic dsl. Although I would have to re-create whatever context “tokens” (state getters) I would want. @pez Does this sound accurate?
Joyride is definitely a good tool for conditionally firing off commands. Without any JSON DSLs, lol. However, VS Code does not have API for querying those when contexts, so they are not available to Joyride. For Calva (and Joyride and any other extension in our control) we can mirror the when contexts and expose as an API. In Joyride and Backseat Driver the mirroring is already happening, but no API is exposing it. Let me know if it would help you to be able to query the Calva when contexts from Joyride.
I haven’t fleshed out my user cases yet, but I think that would be helpful. I was assuming it’s pretty trivial to build or mirror those contexts as needed. But if they’re already set up, then it would be nice to have access to them from user level.
I think that for many of the contexts, it is not possible to recreate them from the outside. For others it is just a lot of work.
Interesting. They do have quite an extensive set there. To me this is part of the heart of the IDE experience, being able to reason about behavior based on user state in the app.
We can’t do anything about reaching VS Code’s when context variables, though. That’s for the VS Code team to fix.
ok, but we can “get” the context for a lot of them via vscode api and joyride, and standardize that to a state map or atom for general use?
> a lot of them Like… can you give an example? Easier to answer then.
i’m just spitballing atm, but i’ll look through the when clauses and try to get some concrete use cases in thinking of.
One i had is that Windsurf broke the hide right sidebar behavior so that when you try to hide the bar when some panel, it goes to their ai-agent panel first, the. if you run the command again, it will hide the panel. So in that case, if that panel was active, i would run the command twice, if not, only once.
thank you so much @pez gratitude
Dear Calva friends: https://github.com/BetterThanTomorrow/calva/releases/tag/v2.0.536 • Fix: https://github.com/BetterThanTomorrow/calva/issues/2945`\r`https://github.com/BetterThanTomorrow/calva/issues/2945`\r\n`https://github.com/BetterThanTomorrow/calva/issues/2945`\r`https://github.com/BetterThanTomorrow/calva/issues/2945