# Inject language into non-injection host elements?

**URL:** <https://platform.jetbrains.com/t/inject-language-into-non-injection-host-elements/2996>\
**Category:** IntelliJ Platform\
**Created:** [October 26, 2025, 4:43pm UTC](https://platform.jetbrains.com/t/inject-language-into-non-injection-host-elements/2996 "2025-10-26T16:43:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![illuminatedcloud](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/illuminatedcloud/32/55_2.png) [@illuminatedcloud](https://platform.jetbrains.com/u/illuminatedcloud)\
**Post date:** [October 26, 2025, 4:43pm UTC](https://platform.jetbrains.com/t/inject-language-into-non-injection-host-elements/2996/1 "2025-10-26T16:43:58Z")

</div>

Is there any (good) way to inject another language into a PSI tree that doesn’t include PSI injection host elements?

To provide specific context, in free (i.e., unlicensed/Community Edition) IDEs, I can easily find/detect string literals even in the absence of a first-class PSI tree, e.g., for JavaScript/TypeScript files, and for some that match well-defined, recognizable patterns, I’d like to inject the corresponding first-class language.

Those files – typically either abstract file type files or TextMate files – don’t have any real PSI structure, so I was wondering if there was some way to tell the injection system that specific text ranges of the `PsiFile` itself should be treated as if they were injection hosts.

Hopefully that makes sense. Let me know if not.

---

<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:** [May 5, 2026, 6:15pm UTC](https://platform.jetbrains.com/t/inject-language-into-non-injection-host-elements/2996/2 "2026-05-05T18:15:02Z")

</div>

Hopefully this is not needed anymore as IntelliJ IDEA provides JS/TS PSI in free mode
