Fork me on GitHub
#spacemacs
<
2020-07-21
>
Kira McLean13:07:55

Hi, I just started using spacemacs and was wondering if anyone here might be able to answer my question. In cljc files only the clj parts are highlighted, cljs parts are greyed out. I’d like for them both to be highlighted at once. I can do that by setting the major mode to clojurescript, but was wondering if there’s a way to “turn on” highlighting for both targets in cljc files. Anyone familiar with clojurec mode have any insight?

practicalli-john13:07:53

The only thing I found in the docs refers to the REPL, but maybe having a ClojureScript repl running would highlight both (just a guess) https://docs.cider.mx/cider/0.25/cljs/up_and_running.html#working-with-cljc-files

Kira McLean13:07:32

I was wondering, that too. I tried keeping a cljs repl running, but doesn’t seem to do what I want.

Kira McLean13:07:52

And hi, by the way! Thanks for the great tutorials on spacemacs! Helped a lot with getting started.

practicalli-john13:07:59

Hello and thanks. There are some options on the dynamic syntax highlighting page. I wonder if its specific things that are not highlighted, rather than all cljs code... https://docs.cider.mx/cider/0.25/config/syntax_highlighting.html Also the #cider channel has several maintainers of CIDER so they should know in general, assuming no answers are forthcoming in this channel.

Kira McLean13:07:55

ah ok great, thanks. I wasn’t sure if it was an issue with my specfic config since I’m using spacemacs or something with cider generally.

practicalli-john14:07:14

Its not always obvious where the cause may be. If you can share the code I can give it a try in my Spacemacs setup.

Kira McLean14:07:24

Ah that last link you sent is brilliant, it was this:

(setq cider-font-lock-reader-conditionals nil)

Kira McLean14:07:38

makes perfect sense once you know where to look! Thanks so much 🙏

practicalli-john14:07:08

Ah yes, I just found this issue with the same question, very useful to know. https://github.com/clojure-emacs/clojure-mode/issues/456#issuecomment-339931350

Kira McLean14:07:50

ah great. yeah.. exact same question! Your google fu is better than mine. Thanks so much for the help! really appreciate it 🙂

Kira McLean14:07:55

I wonder if starting the cljs repl didn’t work because of something else weird in my config.. I just connected to a shadow-cljs nrepl I always keep running.

practicalli-john14:07:06

seems many people find a few challenges using Cider and shadow-cljs together, there seems to be quite a few configs to set.

Kira McLean14:07:07

hm seems possibly related, then. Anyway not a big deal, maybe will investigate later. For now having the syntax highlighting working is great.