CLion
 
Get CLion
You are viewing the documentation for an earlier version of CLion.

Language injections

Last modified: 11 October 2024

Language injections let you work with pieces of code in other languages embedded in your code. When you inject a language (such as HTML, CSS, XML, RegExp, and so on) into a string literal, you get comprehensive coding assistance for the injected code even though it is not the main language of your project.

A language fragment may be combined with a prefix and a suffix that act together as a wrapper, turning the fragment into a syntactically complete language unit. When editing your code, you can see prefixes and suffixes only in the fragment editor. They are not shown in the main editor.

The prefix and the suffix can be included in the injection comment as follows: