lsp

David Greenspan 2026-01-30T18:18:04.809809Z

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.)

ericdallo 2026-01-30T18:45:33.522879Z

not sure I got, but instaed of squiggles (the lines below the text), you want to change the visual tokens of the words?

David Greenspan 2026-01-30T19:16:13.403609Z

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

ericdallo 2026-01-30T19:18:05.629469Z

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

David Greenspan 2026-01-30T19:26:07.262859Z

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.

ericdallo 2026-01-30T19:27:35.958369Z

got it!

ericdallo 2026-01-30T19:28:48.240079Z

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

👍 1
David Greenspan 2026-01-30T19:47:28.369109Z

thanks for your replies

👍 1
pez 2026-01-30T20:49:21.982379Z

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.

ericdallo 2026-01-30T21:31:23.791829Z

yeah, would like to understand as well your case @dgreenspan what kind of different custom things you wanna apply tokens, if you have examples

David Greenspan 2026-01-30T22:14:18.387509Z

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

ericdallo 2026-02-01T12:51:55.900819Z

got it