Setting up WebStorm for page and component files - tremho/thunderbolt-common GitHub Wiki
Page (.tbpg, .tbp) and Component (.tbcm, .tbc) file syntax highlighting
WebStorm, like many other code editors, has syntax assist and color coded themes for different code file types.
A Thunderbolt Page file (.tbpg or .tbp extension) is essentially an XML file with some non-XML parts to it. The same is true for a Thunderbolt Component file (.tbcm or .tbc extension).
Since these are not legal XML files as they are, they are not given the extension .xml, and besides, we want these files to be identified uniquely as Thunderbolt source content.
A true XML file would need to be structured differently to be legal, and would also need to have an associated XSD/DTD schema to be parsed correctly by most IDE editors.
But HTML is a very forgiving subset of XML, and as it happens, an HTML format syntax checker works well with this (at least as I've found on WebStorm). So it's a good idea to set your IDE up to recognize page and component files.
To do this in WebStorm:
- open WebStorm Preferences
- under
Editor -> File Typesfind HTML - in the list of currently mapped file types (*.html, *.htm, *.shtml, etc) add the following:
- *.tbc
- *.tbcm
- *.tbp
- *.tbpg
Now when you edit these files, the XML portion will be syntax aware and notify you of errors, etc. Note you may receive a number of warnings about non-standard HTML (unrecognized tags, etc) that you can safely ignore. Structural errors, though like unclosed tags or bad attribute syntax appear as red errors and are valid issues.
Other IDE editors generally have similar setup features.