Enabling grammar and lexer from LSP Server

Building on IntelliJ IDEA Ultimate 2026.2.1.

I’m very new to IntelliJ plugin development, but started working on implementing a new custom language plugin via an LSP server. The LSP server does expose all of the proper grammar (and that is shown to be consumed by VS code and the Zed editor), but I can’t seem to figure out how to get IntelliJ to use the provided one. All of the example plugins that I’ve been looking at seem to have custom lexers and parsers built as a part of the plugin, rather than taking that functionality from the LSP server.

After my initial implementation, I do have the plugin talking to the LSP server (I am getting docs, intellisense, document structure, etc., and the logs show it is talking correctly), but I’m not getting any of the coloring or highlights within the editor.

Any place that somebody could point me to, to begin figuring out how to enable that? I know LSP server integration support is an evolving thing at the moment, so I’m running into some conflicting documentation.

AFAIK LSP servers do not expose a grammar, see Specification for what is available.

Semantic highlighting is available in LSP, but you need to check how the LSP client of the IDE supports it. Try the latest version or look at the API docs..

VSCode use TextMate-based highlighting and many file types are provided. JetBrains IDEs support TextMate too, but as it‘s not as powerful as a proper grammar, most plugins ship one.

I guess it’s really the semantic highlighting I’m really looking for. The API docs aren’t super clear, and I’m stuck in the bug where I can’t download the source files.

The closest thing I found is the “Developing a language plugin” youtube video : https://youtu.be/xrpVUALnJVM?si=aFqVjrMdQDpgkwwa&t=373 where he does show some of the semantic highlighting just working (he mentioned his LSP server does not have full support, but you can see he has /some/ working out of the box). I’m just not clear what properties I need to set either in the client capabilities or server capabilities to even get anything to be recognized. I know our LSP server supports it because we are getting the support in vscode and zed without doing custom lexers or parsers.

I posted about an experimental Lua LSP plugin I threw together a while back that does highlighting.

Experimental Lua LSP Extension .

The thread has a link to the repo.

Thanks for the link to that write-up and repository. That actually helped me a ton.

After messing with this for 3 days and not getting anywhere, I ended up blowing away the whole .intellijPlatform directory that is attached to the debugging IDE. Next time I loaded the project, the syntax coloring came right up, as defined by the LSP server. There must have been a stale config or something weird cached that was causing it to never process those directives.