Customizable code formatting
Posted: Thu Jul 24, 2008 4:33 pm
Currently the control over code formatting isn't as tweakable as I'd like in Oxygen. I was working on a project the other day when I suddenly had an epiphany: rule-based formatting!
Duh! It makes perfect sense. When I found myself wishing for a way to automate formatting of my code, I initially thought to myself, "Well, it will be boring and a diversion from my current projects, but I could write an XSL stylesheet to format code…" That way I would get all the control I need.
But then I realized that the control is coming from XPath. So, I would like to put in a request for XPath-based rules for code formatting. You've already got great XPath support built-in, so if I could just specify rules like, "Normalize all space within the text of <p> elements", then I could just type in "p/text()" and check a box that says "normalize".
Duh! It makes perfect sense. When I found myself wishing for a way to automate formatting of my code, I initially thought to myself, "Well, it will be boring and a diversion from my current projects, but I could write an XSL stylesheet to format code…" That way I would get all the control I need.
But then I realized that the control is coming from XPath. So, I would like to put in a request for XPath-based rules for code formatting. You've already got great XPath support built-in, so if I could just specify rules like, "Normalize all space within the text of <p> elements", then I could just type in "p/text()" and check a box that says "normalize".