Preserve space in <xsl:text>

When I reformat XSL code, white space from <xsl:text> </xsl:text> is stripped, is there any way to tell IntelliJ to leave this tag alone?

5 comments

No, currently the only way would probably be to set the option "keep white spaces" under Settings | Code Style | XML, though this will apply to XML formatting in general.

Sascha

0

Well, this way will formating loose lot of power, but at least it will not produce bugs. How does formatting API looks like, is there any chance I can fix it by writing a plugin or should I just give up.

0

There is a formatting API, but only very recently it has been opened for customizing the formatting of core-languages (see http://www.jetbrains.net/jira/browse/IDEADEV-5528). But since this particular build has not even been released yet, I don't know if it would be possible with a reasonable effort (i.e. without re-implementing the whole XML formatting).

There's also http://www.jetbrains.net/jira/browse/IDEA-4667 which, if ever implemented, could be used to declare just xsl:text to be left alone during formatting.

BTW: You may want to have a look at the XPathView+XSLT-Support plugin at
http://plugins.intellij.net/plugin/?id=237 that provides a lot of functionality for developing XSLT. The plugin is currently available for IDEA 5.x and will support 6.0 around the time it's officially released. I will also consider to tweak the formatting of xsl:text in the plugin if the mentioned API turns out to be usable for that task.

Sascha

0

Thanks for your comments. If you can put it in XPathView+XSLT-Support plugin it would be great, otherwise I'll wait for 6.0 release and come back to it when it bites me again.

0

Libor Valenta wrote:

Thanks for your comments. If you can put it in XPathView+XSLT-Support plugin it would be great, otherwise I'll wait for 6.0 release and come back to it when it bites me again.


I've had a look at the new API, but it doesn't seem to allow to make surgical
changes to the XML formatting. So, unfortunately, if this doesn't change, the
plugin will not get that functionality.

Sascha

0

Please sign in to leave a comment.