Fork me on GitHub
#calva
<
2024-01-21
>
fjolne15:01:49

Hi! I was looking for a way to use Calva's Paredit for Racket, but I couldn't find a way to make Paredit commands enabled in non-.clj files: they just don't appear in Command Palette. Looking for advice 🙏

Bob B16:01:35

I'm by no means an expert on this, but I don't think it's possible as-is without changing the doc's language ID to clojure. It looks like calva maintains a 'mirror document' for clojure editors (presumably to track the parsing and movement positions and what-not). When I tweak a keyboard shortcut to also handle languageID being racket, and then use a keyboard shortcut, I get an error that says 'Missing mirror document!', which tracks back to an association calva makes between a VSCode document and a mirror document, which is only made if the document's languageID is clojure.

pez17:01:05

I think @U013JFLRFS8 has made a pretty spot on assessment. It wouldn’t be easy to make this work. If you tell vs code that your racket file is clojure, you might get something working, but I don’t know if even that will help.

fjolne18:01:48

@U013JFLRFS8 @U0ETXRFEW Thank you for the response! Changing the document languageID to Clojure works, but this way I lose Racket's LSP/etc. Will look into other paredit extensions then, thank you anyway!