Live Templates Not Working Right
I've been googling and searching and can't
find anybody else that has listed the same problem.
I have some live templates setup for HTML. If I'm positioned within the <body> tag and type my live template abbreviation div:class I get <div ></div> just fine... however if I go into that <div> section or anything under that and type div:class and hit Tab (my expansion key) it just deletes what I typed which is div:class and does nothing else.
I'm just getting started using WebStorm and it's awesome, but this has me stumped.
Thanks in advance for any assistance.
Aloha,
James
Please sign in to leave a comment.
Hello!
how did you defined your template? What 'Applicable in' is set to? Can you provide a screencast that shows up your issue?
Best regards,
Lena
I uploaded a video, here's the link: http://youtu.be/8Duy4yYfZco
Hi James,
seems that you have some language injected in your HTML body (note that light green background). As a result you are trying to apply the template in context that doesn't match the expected one (HTML) . Try un-injecting the language and see if the problem persists
Best regards,
Lena
Hey,
Thanks for your help so far. However, it seems the offending tag is the <body> tag, but that's a standard html tag. If I change the "<body>" tag to a "<div>" tag, everything works properly and is highlighted properly, if I put in the "<body>" tag it goes green again. Is there a setting somewhere I should be looking at or something?
Thank you!
Aloha,
James
I found it, you lead me down the right path...
I went into Settings > Language Injections and unchecked the "xml: body" Apple JS entry and everything appears to be working honky dory...
Thanks again!
Aloha,
James
Thanks, James. That was the solution!
Wouldn't have found it by myself, so you just saved me quite a bit of time.
Strange that a default option in WebStorm would cause this behaviour.
Detecting (the content of) a body and head tag as another language... Strange.