I am trying to enable knockout.js-specific code highlighting in phpstorm using language injections.
So far I was able to do so in data-bind
XML attributes, which was pretty straightforward:
But I can't figure out how to create an injection for knockout-style comments <!-- ko: --> <!-- /ko -->
There is a generic xml injection in php storm, but I don't know what to put in the 'Places patterns' section:
It's not possible without a WebStorm/PHPStorm plugin.
<!-- ko if: someExpressionGoesHere -->
<li>I want to make this item present/absent dynamically</li>
<!-- /ko -->
Is one style of comment, you would need to set up language injection for the DSL (Domain Specific Language) of the knockout templating style, as well as getting it to handle the javascript inside the comment.
Since the 'if:' DSL inside the comment, doesn't register as a HTML attribute (It's wholly ignored as a comment), Doesn't match the attribute format, and that the feature doesn't have support for having comments have meaningful semantics, we are screwed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With