lsp

István Karaszi 2024-12-15T20:25:56.149119Z

What do I need to do if I want to syntax highlight a custom macro defcustom. For some reason it does not do the syntax highlighting in my env. I added {:lint-as {ns/defcustom clojure.core/defn}} but that was not enough it seems.

ericdallo 2024-12-16T12:30:56.018859Z

Do you have a print? it should color it as a macro

István Karaszi 2024-12-16T12:42:54.671079Z

It should color it same as defmethod or defmulti

István Karaszi 2024-12-16T12:43:10.293679Z

I tried to look for the documentation how to do it, but I could not find a way

ericdallo 2024-12-16T13:20:09.081849Z

it looks correct to me, so please provide screenshot of how it looks for you

István Karaszi 2024-12-16T14:13:13.777389Z

It looks like this:

ericdallo 2024-12-16T14:14:07.474259Z

ah so it's not only syntax highlight, there is a diagnostic error on something , which means the clj-kondo config is not configured properly

István Karaszi 2024-12-16T14:14:46.126049Z

I believe that only complains because the something is not used

István Karaszi 2024-12-16T14:15:11.215669Z

Yes, that is why it is underscored

ericdallo 2024-12-16T14:15:21.580959Z

weird, it's red

István Karaszi 2024-12-16T14:15:23.166169Z

ericdallo 2024-12-16T14:15:33.025949Z

ok

ericdallo 2024-12-16T14:15:54.645029Z

so, almost sure you have LSP semantic tokens disabled

István Karaszi 2024-12-16T14:16:05.426139Z

could be the case

ericdallo 2024-12-16T14:16:05.964479Z

you are using emacs only syntax highlight

István Karaszi 2024-12-16T14:16:14.054919Z

yes!

ericdallo 2024-12-16T14:16:29.640819Z

make sure you have (setq lsp-semantic-tokens-enable t)

István Karaszi 2024-12-16T14:18:07.328269Z

thank you very much!

👍 1
István Karaszi 2024-12-16T16:30:45.737279Z

Unfortunately now and then the syntax gets really messed up

István Karaszi 2024-12-16T16:31:18.789449Z

ericdallo 2024-12-16T17:04:51.141989Z

Weird, maybe some issue with lsp-mode

István Karaszi 2024-12-16T18:59:15.120989Z

Could he the reason but I did not see this before