Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XText Formatter: organize elements
XText Formatter: organize elements [message #1748617] Fri, 25 November 2016 10:28 Go to next message
Andrey Petrenko is currently offline Andrey PetrenkoFriend
Messages: 8
Registered: March 2016
Junior Member
Is there a way to organize elements during formatting?

For example if I have imports

import A.A
import B.C
import A.B
import B.B

after formatting I want to get to following result

import A.A
import A.B

import B.B
import B.C
Re: XText Formatter: organize elements [message #1748829 is a reply to message #1748617] Tue, 29 November 2016 07:57 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 83
Registered: January 2016
Location: Kiel

Formatting should only adjust whitespace and not change the semantic model. What you are asking for looks more like an "organize import" clean up.

So, yes, you can do that but not with the formatter. You could for instance change the model and then use the serializer to write it back.

Have a look at the OrganizeImportsHandler here:
Previous Topic:EMFModelInferrer
Next Topic:Addictional Optional Argument Recognition
Goto Forum:

Current Time: Fri Jun 02 16:38:36 GMT 2023

Powered by FUDForum. Page generated in 0.01798 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top