Ember.js, handlebars, syntax checking

Good Evening All,

I have been using WebStorm for a site I am working on. So far, it is a great tool!

But I am having an issue with the syntax checking when using handlebars in my html. My HTML looks like this:

<script data-template-name="tree-node" type="text/x-handlebars">
                    <span {{bindAttr }} {{action toggle}} >
                        {{#if isExpanded}}
                        &#x25BC;
                        {{else}}
                        &#x25B6;
                        {{/if}}
                    </span>
                    <a {{action click}} >{{text}}</a>
                    {{#if isExpanded}}
                        {{control "treeBranch" content}}
                    {{/if}}
</script>



The handlebars stuff makes the editor show errors inside the tags where it is used. It isn't stopping me from using the tool and I understand the handlebars stuff isn't standard HTML, but I was wondering if there is a way to get it to either ignore everything in the {{}} blocks or to actually parse it and only generate errors where there are actual errors.

Thanks,

Howard
5 comments

Nobody at all has at least a suggestion for this question? I looked on Google and I'm using the latest PHPStorm 7 EAP and Ember.js/Handlebars syntax still doesn't work well.

Sorry if I'm not providing an answer, I've found that thread while looking for an answer myself.

I wish I could have syntax highlighting within handlebars' script tag (for ember.js):

For example:

<script type="text/x-handlebars" data-template-name="wineries">
{{#each}}
    <p>{{name}}</p>
{{/each}}
</script>

0

Works fine for me using the latest PHPStorm 7 build - content of script tag is treated as HTML, no errors shown
Please make sure to install 'EJS' and 'Handlebars/Mustache' plugins from the repository (Settings/Plugins, Browse repositories...)
Full support will be available when http://youtrack.jetbrains.com/issue/IDEA-106449 is fixedhttp://youtrack.jetbrains.com/issue/IDEA-106449

0

Ups... sorry - works fine in WebStorm7, but not in PHPStorm 7

:(
0

Thanks for your response!

I had handlebars/mustache installed but not EJS, I installed it, restarted and still see this:

Screen Shot 2013-10-16 at 11.34.56 AM.png
Any ideas? Thanks

0

Seems that 'EJS' and 'Handlebars/Mustache' plugins available in the repository are outdated, and WebStorm bundles newer versions...

0

Please sign in to leave a comment.