Language injection configuration example.
Hi.
We have custom templates in our code. We use {js}{/js} and {php}{/php} to embed code in files. Becouse of this we don't have support for this language. I tried to configure the Language Injection but I'm not able to achieve this. Please give me an example how to achieve it.
Best regards.
Please sign in to leave a comment.
Short answer: its not currently possible.
In particular PHP is not injectable language, but rather a master language that can contain other content.
Unfortunately its delimenters are not configurable, and this has serious technical reasons.
As for JavaScript, you need an host language (i.e. HTML or other) that supports required style of injection into arbitrary literals and that's not currently possible without writing relatively complex IDE plugin.
OK.
Tag {js} and {/js} is in *.html file.
Best Regards.
Bump.
+1 for custom language injection in templates.
Even though this might not be possible for PHP as stated below, it would be extremely useful to have such a feature inside Smarty/HTML templates. We're using exactly the same method as described to embed {js}, {css} and {scss} blocks in our templates. Autodetection might be too difficult to achieve because these tags are custom made, so just having a simple (configurable) tag detection to associate the language between block tags would be fine. Even a manual workflow (mark beginning/end of a block and choose the content type to apply to) would already help.
Best regards,
willydee
Hi Wilfried,
Please check Issue Tracker for existing ticket (I have not found one myself, but maybe you will be more lucky). If there is none -- please submit new Feature Request there (otherwise this may remain as ordinary comment only).
In any case -- somehow related tickets:
Hello Andriy,
thanks for the quick reply. Since I was also uable to find a similar entry in the tracker, I opened a feature request as you suggested.
See http://youtrack.jetbrains.com/issue/WI-10478
Best regards,
willydee