# LSP plugin for templating language

**URL:** <https://platform.jetbrains.com/t/lsp-plugin-for-templating-language/1115>\
**Category:** IntelliJ Platform\
**Created:** [March 27, 2025, 6:44am UTC](https://platform.jetbrains.com/t/lsp-plugin-for-templating-language/1115 "2025-03-27T06:44:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_Jarrett.oell](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@Simon\_Jarrett.oell](https://platform.jetbrains.com/u/Simon_Jarrett.oell)\
**Post date:** [March 27, 2025, 6:44am UTC](https://platform.jetbrains.com/t/lsp-plugin-for-templating-language/1115/1 "2025-03-27T06:44:05Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![insyncwithfoo](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/insyncwithfoo/32/158_2.png) [@insyncwithfoo](https://platform.jetbrains.com/u/insyncwithfoo)\
**Post date:** [March 27, 2025, 6:57am UTC](https://platform.jetbrains.com/t/lsp-plugin-for-templating-language/1115/2 "2025-03-27T06:57:40Z")

</div>

[The _Language Server Protocol_ specification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/) does not have a concept of language injection, so that part will have to be implemented by the plugin itself.

---

<div class="post-metadata">

**Author:** ![xepozz](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/xepozz/32/589_2.png) [@xepozz](https://platform.jetbrains.com/u/xepozz)\
**Post date:** [March 27, 2025, 7:15am UTC](https://platform.jetbrains.com/t/lsp-plugin-for-templating-language/1115/3 "2025-03-27T07:15:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![yuriy.artamonov](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/yuriy.artamonov/32/48_2.png) [@yuriy.artamonov](https://platform.jetbrains.com/u/yuriy.artamonov)\
**Post date:** [March 27, 2025, 7:57am UTC](https://platform.jetbrains.com/t/lsp-plugin-for-templating-language/1115/4 "2025-03-27T07:57:36Z")

</div>

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

> **[intellij-plugins/handlebars at master · JetBrains/intellij-plugins](https://github.com/JetBrains/intellij-plugins/tree/master/handlebars)**
>
> Open-source plugins included in the distribution of IntelliJ IDEA Ultimate and other IDEs based on the IntelliJ Platform - JetBrains/intellij-plugins

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