Hi Eclipse forum,
Is it possible to always force comments to move to the end of their line during serialization? My dilemma is that I've parsed a model and used API commands to add some extra arguments to a line with a comment and the arguments were simply appended to the end of the line. This placed them after the comment which, despite being tagged as a semantic region, effectively makes them into comments upon serialization. To illustrate:
Original line: keyword arg1 arg2 //SL_COMMENT
Desired line: keyword arg1 arg2 arg3 //SL_COMMENT
Outcome: keyword arg1 arg2 //SL_COMMENTarg3
A similar issue will also occur with ML_COMMENTS:
Original line: keyword arg1 arg2
//ML_COMMENT
Desired line: keyword arg1 arg2 arg3
//ML_COMMENT
Outcome: keyword arg1 arg2
//ML_COMMENTarg3
When comments are not involved, adding new arguments to a model via API commands behaves as expected. I've tried to address this via the formatter since the added arguments are still correctly treated as semantic regions. However, I don't see an obvious way to reorder the hidden and semantic regions. Additionally, using append and/or prepend commands to target the comment's hidden region does not seem to apply the spacing as specified.
Any suggestions or insights would be appreciated!