Is it possible to write some kind of language server plugin or something like a clj-kondo hook that, instead of producing linter errors/messages, just affects syntax highlighting in some other way, highlighting certain text as a visual cue? (I'm using Calva/VS Code fwiw.)
not sure I got, but instaed of squiggles (the lines below the text), you want to change the visual tokens of the words?
it's more that I don't want to generate linter errors/warnings/infos, because those are kind of like "issues," even if level "info," and get reported in various ways (depending on the dev's IDE and workflow). I just want the LSP to attach something that my IDE can use for syntax highlighting
still don't get it the problem, but you can disable disagnostics probably via Calva, just not sure the name, #calva may be best to ask, I still don't recommend disabling them
it's not about disabling diagnostics. we like and using linting. I'm talking about how to do custom syntax highlighting, basically. I want to create a rule that, under certain conditions, causes the LSP to report additional syntax highlighting information to the IDE, not additional linter messages.
got it!
yeah that's not supported, what you want is some kind of custom semantic tokens , we do have the semantic tokens feature in clojure-lsp but we don't allow user to create "hook" likes, but it sounds interesting.
• we do have custom linters
• I'm working on have custom code actions soon
• I believe custom semantic tokens may be interested in the future, feel free to create a issue about it in clojure-lsp
thanks for your replies
You can definitely create a language server that only produces semantic tokens. But if clojure-lsp can support some API for it, that sounds very much awesomer.
yeah, would like to understand as well your case @dgreenspan what kind of different custom things you wanna apply tokens, if you have examples
we're thinking of writing a macro that walks the AST and optimizes certain forms. it would be nice to see in the IDE which forms meet the criteria
got it