LSP plugin for templating language

Hi, I’ve got a language plugin for a templating language and was thinking about writing an LSP instead. Does anyone have any experience with LSPs that could advise?

It’s basically HTML with language injections: my custom language plus a language provided by the IDE (ruby).

Is this something that works well with LSPs? Can I easily tell the IDE which sections are HTML and Ruby and it will do the highlighting and intelligence for those sections?

The Language Server Protocol specification does not have a concept of language injection, so that part will have to be implemented by the plugin itself.

1 Like

Hi, @Simon_Jarrett.oell
I think the best way to do you want is to create a specific plugin with your own rules. It could be like Vue JS plugin, with HTML, CSS, JS in a file.

LSP does not have Language Injection, but you may create Language Service that could trigger Ruby service to interact with your part of Ruby code. It’s necessary, because, I think, Ruby does not understand your custom format file.

Creating IDEA Language Injection isn’t a big deal, just a few lines to make your text in a boundary be any language.

The integration will be 100% better if you do just template language in our technology. See Handlebars plugin as example on Github.

And most importantly, your users will not lose any of built-in features and other languages will integrate properly