XF 2.1 Editing .less files in phpStorm with XenForo template sytax

Jake B.

Well-known member
Just curious if anyone else uses phpStorm for XenForo development, and if so how do you deal with editing .less files containing XF's template syntax without being harassed by all of the syntax errors it generates?
 
I just allow it to harass me 🤷‍♂️

Do you not get the annoying forced super-indentation inside of the template tags too?

192341

That's where it attempts to place my cursor if I press return after the xf:if tag. For the past year or so I've used the XF editor only for .less templates because of these goofy things :P
 
I honestly don’t let it ruin my day and I just work around any indentation or inspection highlighting issues.

I think it only affects 2 templates in total.

Of course one could argue that template conditionals in Less should be avoided where possible anyway. We don’t tend to use it in this way. We almost exclusively use it for semi-generated code like smilies and reactions sprites. It’s also easy to fall foul of CSS caching too.
 
and reactions sprites.

That's actually exactly what I'm using it for right now, I may just move the part with the loop/conditional into a separate .less template so I will never have to look at it again :P The errors don't necessarily bother me when I'm viewing the actual file, it's mostly annoying when the little squiggly propagates its way up the project's file tree and constantly makes me think I left some syntax error somewhere, but that can be avoided by never having to open the file again as well ;)

Other than that I think we use it in a couple places we allow people to select a color override for something and want to make sure that color value isn't empty before trying to show it
 
Top Bottom