Community
Participate
Working Groups
The templates should be properly indented on insert. Given recent rewrites of the ant editor formatter we ought also to be able to format tags as specified in the user preferences.
From a mail on eclipse-platform-text (Tom Eicher 3/19/2004) > About the formatting: This is something the template context is > responsible for, since there may be many different context types in a > document (context types map to partitions in many ways) that have > different formatters. A template context contains all the information > needed to evaluate a template at a specific location in a document. > For an example, the JavaContext does that already: it formats (well, it > tries to...) a code template when it evaluates it. So, when you add your > Ant context type, you might add a specific AntContext which will extend > the default TemplateContext with formatting capabilities.
At present the document formatter responsible for fixing the indentation doesn't know how to format anything but the whole document at once. I'd like to add support so that it respects a selected region. You could then use this to format the inserted templates. On the other hand, if you already have code in the auto-indent strategy to handle this it might be faster to do it that way. We can always make the support more robust later.
I have got the formatting working but I really do not see how to easily update the position of the variables in the template. What the Java guys do is create a document, add a position updater to the document, add positions to the document for all of the offset of the variables in the document, then update the variables with the new positions after the doc has been modified. I think we can do the same thing in our formatter...but phew!! more than I had anticipated :-)
The code is all there in AntContext but does not quite work for fixing up the positions of the template variables (so it is disabled). Should be possible to tweak post M9
*** Bug 57509 has been marked as a duplicate of this bug. ***
Still disabled but I have moved the code to use the XmlFormatter and moved the support for formatting the template buffer to this class. Still got to figure out why the variable positions are not updated correctly...
Changes to AntContext, XmlDocumentFormatter, XmlDocumentFormattingStrategy and XmlFormatter.
Removed the preference from the preference page...sigh
Deferred to post 3.0
As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you.