Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 318611

Summary: Structural Compare
Product: [Modeling] TMF Reporter: Dénes Harmath <thsoft>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: moritz.eysholdt, sven.efftinge
Version: 1.0.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Dénes Harmath CLA 2010-07-01 10:31:01 EDT
Build Identifier: I20100608-0911

It would be great if Xtext provided Structural Compare which would ignore whitespace, comments etc. and gave a more semantic view when comparing two files.

Reproducible: Always
Comment 1 Moritz Eysholdt CLA 2010-07-01 10:38:43 EDT
I like the idea to explicitly exclude
- whitespaces
- comments
- order of lists when order has no semantic???

from a textual comparison.

If you've been thinking of tree views for comparison, EMF Compare is the way to go. Since Xtext implements an EMF Resource they should work together flawlessly.
Comment 2 Sven Efftinge CLA 2010-07-01 13:02:35 EDT
Doesn't the standard text diff support ignoring whitespace?
Do you really think ignoring comments is a good idea?
Comment 3 Moritz Eysholdt CLA 2010-07-01 18:10:49 EDT
(In reply to comment #2)
> Doesn't the standard text diff support ignoring whitespace?

Optionally, it does. A quick test reveals that with this option enabled changes in line wraps are not consequently ignored. Not sure if this is intentional or a bug.

> Do you really think ignoring comments is a good idea?

Not per default. But it's an interesting idea.

I think when people look at the comparison window they still have to do a lot of brain work to filter relevant changes from irrelevant changes.

For example, a comparison mode would be great that would ignore all changes the formatter can/has applied to a file.


In the comparison window, think of a menu like this:

Show changes for:
[ ] Whitepaces and Line Breaks
[ ] Comments
[ ] Order of Elements (where order has no semantic)
[ ] Cross References which still refer to the same target

The last option might hide changes created by "organize imports"
Comment 4 Sven Efftinge CLA 2012-11-14 05:09:57 EST
see comment 2