Easiest way to add custom tags to PHPStorm/Webstorm...

First of all, I must say that PHPStorm/Webstorm is such an amazing product. Since 2.0 came out, just having PHPStorm has improved the quality of code at our work, and has made working with PHP not only bearable but a joy.  

So here is my question.  At my company we have an internal set of, let's call them extensions, to HTML (very similar to JSP custom tags).  I would love to have our Design group start working with Webstorm and I feel the best way to sell the feature is that they would get intellisense with our custom tags.  We generate as WSDL that some of us use in Visual Studio to get intellisense, is there any way we can easily (without having a to write a full blown plug-in) add these custom tags to Webstorm/PHPStorm?  Currently I have set the filetype of these files to JSP and everything works pretty well, but it would be really nice to find some way to add these tag definitions to the editor.  Thanks in advance,

Kris

12 comments
Comment actions Permalink

Try add custom tags:

custom-tags.png

0
Comment actions Permalink

Thanks for the reply.  I actually saw that earlier, but to be more clear: we have over 200 tags, and each tag could have up to 10 attributes.   The WSDL that we create is thousands of lines long.  Marking the files as JSP allows me to work perfectly fine, I just want to add Intellisense to the tags so that UI designers and others unfamiliar with the tag don't have to go to our documentation and look at all the possible attributes for each tag...

Kris

0
Comment actions Permalink

Do you have a xml schema / dtd of your tags of some sort?

0
Comment actions Permalink

Absolutely, we have a XSD of our tags that is auto-generated...

0
Comment actions Permalink

Does the xsd have the same namespace identifier as htmls or not (you use <tagname or <someprefix:tagname in the code) ?

0
Comment actions Permalink

Hi Maxim,

i have the same situation ... and in my case we are using tags like "<someprefix:tagname someAttr="" ...>"

Michael

0
Comment actions Permalink

Unfortunately the xsd has the same namespace as html (we use <tagname not <someprefix:tagname).  I wish we had thought a lot more about namespaces 10 years ago when we designed it, but we are stuck with a single namespace, and unfortunately because it is mixed with html the source may or may not be well formed.

0
Comment actions Permalink

Please clone html schema, add your tags, in Resources setting specify some urn in default HTML type and specify binding of urn to your schema file.

0
Comment actions Permalink

You need to add xmlns:someprefix = "urn:mytags" to root node and bind urn:mytags to some schema file in Resources setting

0
Comment actions Permalink

Where do I get the HTML schema, and how is that going to work since HTML is not valid XML?

0
Comment actions Permalink

Pressing Control + B over html tag name navigates to HTML schema file.
HTML is not XML but its nesting structure (tag nesting rules) can be specified via schema or dtd (and we are going to use extended set of tags for the schema).

0
Comment actions Permalink

Thanks, I used a hacked version of the microsoft html5.xsd  (ripping out all of the asp stuff) and it worked pretty well.  I will switch it to your schema and hopefully it will work even better.  Thanks for all the help!

Kris

0

Please sign in to leave a comment.