Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show number of differences in the Compare editor #504

Closed
pbodnar opened this issue Jun 17, 2023 · 11 comments · Fixed by #731
Closed

Show number of differences in the Compare editor #504

pbodnar opened this issue Jun 17, 2023 · 11 comments · Fixed by #731
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@pbodnar
Copy link

pbodnar commented Jun 17, 2023

Anyone who have ever tried to count all the change markers of the Compare editor for a large file, will probably say it might be quite a lengthy procedure.

So it would be pretty handy to have the number of differences explicitly displayed when comparing files in the Compare editor. IntelliJ IDEA has got this for years already - see for example their screenshot at https://www.jetbrains.com/help/idea/comparing-files-and-folders.html#comparing_files.

It is probably for a discussion where exactly to place that # difference(s) label. Some Compare editor related data are already displayed down in the workbench status bar, but this is quite far from where users will typically be looking at?

@mickaelistria mickaelistria added the enhancement New feature or request label Jun 19, 2023
@mickaelistria
Copy link
Contributor

On the top of the compare editor, just above the text viewer, I see "Text Compare". I imagine the amount of difference could be prompted here: "Text compare: 12 different blocks, 123 lines". However, I suspect this would be per "compare" starategy (ie how you count differences in Text Compare is not how you'd count difference in some Java compare where one would care about eg "1 field with different name, 1 method returning different type...." and this kind of AST-oriented information.

@pbodnar
Copy link
Author

pbodnar commented Jun 19, 2023

@mickaelistria, thanks for the suggestions. So what about displaying just the number of differences (or "different blocks", as you suggest) for the beginning?

I guess this could work regardless of concrete compare strategy (e.g. Java Structure Compare) - the number of differences only for the currently displayed "structured block" would be displayed as illustrated on this picture:

image

@mickaelistria
Copy link
Contributor

Yes, just mentioning "differences" and let the compare strategy decide of what it calls a difference (ie a block of text, an AST element...) would probably be best.

@pbodnar
Copy link
Author

pbodnar commented Jun 19, 2023

Yes, and I think it would be ideal if the number displayed would simply match the number of "change markers" next to the scrollbar.

@lathapatil
Copy link
Contributor

2023-09-11_16h50_14.mp4

Refer the attached video for this enhancement which shows the differences in compare editor. Let me know if this is fine to go ahead with PR?

@mickaelistria
Copy link
Contributor

This proposal seems good to me.

@iloveeclipse
Copy link
Member

Let me know if this is fine to go ahead with PR?

Yes please.

lathapatil added a commit to lathapatil/eclipse.platform that referenced this issue Oct 6, 2023
Show number of differences (Ex: 6 Differences) in the toolbar of compare
editor
which matches "Change markers" next to the scroll bar in compare editor

Fixes eclipse-platform#504
lathapatil added a commit to lathapatil/eclipse.platform that referenced this issue Oct 16, 2023
Show number of differences (Ex: 6 Differences) in the toolbar of compare
editor
which matches "Change markers" next to the scroll bar in compare editor

Fixes eclipse-platform#504
lathapatil added a commit to lathapatil/eclipse.platform that referenced this issue Oct 25, 2023
Show number of differences (Ex: 6 Differences) in the toolbar of compare
editor
which matches "Change markers" next to the scroll bar in compare editor

Fixes eclipse-platform#504
lathapatil added a commit to lathapatil/eclipse.platform that referenced this issue Oct 31, 2023
Show number of differences (Ex: 6 Differences) in the toolbar of compare
editor
which matches "Change markers" next to the scroll bar in compare editor

Fixes eclipse-platform#504
lathapatil added a commit to lathapatil/eclipse.platform that referenced this issue Nov 10, 2023
Fixed Issues identified during review :

1. The label is not recomputed if the diff config changes
	(Ignore White Space).
2. The label is incorrect for zero changes - it says 0 Difference

3. Test case failure

Fixes eclipse-platform#504
lathapatil added a commit to lathapatil/eclipse.platform that referenced this issue Nov 10, 2023
Show number of differences (Ex: 6 Differences) in the toolbar of compare
editor
which matches "Change markers" next to the scroll bar in compare editor

Fixes eclipse-platform#504
lathapatil added a commit to lathapatil/eclipse.platform that referenced this issue Nov 10, 2023
Fixed Issues identified during review :

1. The label is not recomputed if the diff config changes
	(Ignore White Space).
2. The label is incorrect for zero changes - it says 0 Difference

3. Test case failure

Fixes eclipse-platform#504
lathapatil added a commit to lathapatil/eclipse.platform that referenced this issue Nov 10, 2023
Show number of differences (Ex: 6 Differences) in the toolbar of compare
editor
which matches "Change markers" next to the scroll bar in compare editor

Fixes eclipse-platform#504
lathapatil added a commit to lathapatil/eclipse.platform that referenced this issue Nov 10, 2023
Show number of differences (Ex: 6 Differences) in the toolbar of compare
editor
which matches "Change markers" next to the scroll bar in compare editor

Fixes eclipse-platform#504
Show number of differences in the Compare editor eclipse-platform#504

Fixed Issues identified during review :

1. The label is not recomputed if the diff config changes
	(Ignore White Space).
2. The label is incorrect for zero changes - it says 0 Difference

3. Test case failure

Fixes eclipse-platform#504
lathapatil added a commit to lathapatil/eclipse.platform that referenced this issue Nov 30, 2023
Show number of differences (Ex: 6 Differences) in the toolbar of compare
editor
which matches "Change markers" next to the scroll bar in compare editor

Fixes eclipse-platform#504
Show number of differences in the Compare editor eclipse-platform#504

Fixed Issues identified during review :

1. The label is not recomputed if the diff config changes
	(Ignore White Space).
2. The label is incorrect for zero changes - it says 0 Difference

3. Test case failure

Fixes eclipse-platform#504

Conflicts resolution
lathapatil added a commit to lathapatil/eclipse.platform that referenced this issue Dec 1, 2023
Show number of differences (Ex: 6 Differences) in the toolbar of compare
editor
which matches "Change markers" next to the scroll bar in compare editor

Fixes eclipse-platform#504
Show number of differences in the Compare editor eclipse-platform#504

Fixed Issues identified during review :

1. The label is not recomputed if the diff config changes
	(Ignore White Space).
2. The label is incorrect for zero changes - it says 0 Difference

3. Test case failure

Fixes eclipse-platform#504

Conflicts resolution
lathapatil added a commit to lathapatil/eclipse.platform that referenced this issue Dec 11, 2023
Show number of differences (Ex: 6 Differences) in the toolbar of compare
editor
which matches "Change markers" next to the scroll bar in compare editor

Fixes eclipse-platform#504
Show number of differences in the Compare editor eclipse-platform#504

Fixed Issues identified during review :

1. The label is not recomputed if the diff config changes
	(Ignore White Space).
2. The label is incorrect for zero changes - it says 0 Difference

3. Test case failure

Fixes eclipse-platform#504

Conflicts resolution
lathapatil added a commit to lathapatil/eclipse.platform that referenced this issue Dec 11, 2023
Show number of differences (Ex: 6 Differences) in the toolbar of compare
editor
which matches "Change markers" next to the scroll bar in compare editor

Fixes eclipse-platform#504
Show number of differences in the Compare editor eclipse-platform#504

Fixed Issues identified during review :

1. The label is not recomputed if the diff config changes
	(Ignore White Space).
2. The label is incorrect for zero changes - it says 0 Difference

3. Test case failure

Fixes eclipse-platform#504

Conflicts resolution
lathapatil added a commit to lathapatil/eclipse.platform that referenced this issue Dec 11, 2023
Show number of differences (Ex: 6 Differences) in the toolbar of compare
editor
which matches "Change markers" next to the scroll bar in compare editor

Fixes eclipse-platform#504
Show number of differences in the Compare editor eclipse-platform#504

Fixed Issues identified during review :

1. The label is not recomputed if the diff config changes
	(Ignore White Space).
2. The label is incorrect for zero changes - it says 0 Difference

3. Test case failure

Fixes eclipse-platform#504

Conflicts resolution
lathapatil added a commit to lathapatil/eclipse.platform that referenced this issue Dec 11, 2023
Show number of differences (Ex: 6 Differences) in the toolbar of compare
editor
which matches "Change markers" next to the scroll bar in compare editor

Fixes eclipse-platform#504
Show number of differences in the Compare editor eclipse-platform#504

Fixed Issues identified during review :

1. The label is not recomputed if the diff config changes
	(Ignore White Space).
2. The label is incorrect for zero changes - it says 0 Difference

3. Test case failure

Fixes eclipse-platform#504

Conflicts resolution
lathapatil added a commit to lathapatil/eclipse.platform that referenced this issue Dec 19, 2023
Show number of differences (Ex: 6 Differences) in the toolbar of compare
editor
which matches "Change markers" next to the scroll bar in compare editor

Fixes eclipse-platform#504
Show number of differences in the Compare editor eclipse-platform#504

Fixed Issues identified during review :

1. The label is not recomputed if the diff config changes
	(Ignore White Space).
2. The label is incorrect for zero changes - it says 0 Difference

3. Test case failure

Fixes eclipse-platform#504

Conflicts resolution
lathapatil added a commit to lathapatil/eclipse.platform that referenced this issue Dec 20, 2023
Show number of differences (Ex: 6 Differences) in the toolbar of compare
editor
which matches "Change markers" next to the scroll bar in compare editor

Fixes eclipse-platform#504
Show number of differences in the Compare editor eclipse-platform#504

Fixed Issues identified during review :

1. The label is not recomputed if the diff config changes
	(Ignore White Space).
2. The label is incorrect for zero changes - it says 0 Difference

3. Test case failure

Fixes eclipse-platform#504

Conflicts resolution
lathapatil added a commit to lathapatil/eclipse.platform that referenced this issue Dec 20, 2023
lathapatil added a commit to lathapatil/eclipse.platform that referenced this issue Dec 21, 2023
iloveeclipse pushed a commit that referenced this issue Dec 21, 2023
@iloveeclipse
Copy link
Member

@lathapatil : could you please add N&N entry for the change in compare editor?
It should be done in https://github.com/eclipse-platform/www.eclipse.org-eclipse repo, on this file: https://github.com/eclipse-platform/www.eclipse.org-eclipse/blob/master/news/4.31/platform.html

@iloveeclipse iloveeclipse added this to the 4.31 M1 milestone Dec 21, 2023
@iloveeclipse
Copy link
Member

The new test fails on SDK build

https://download.eclipse.org/eclipse/downloads/drops4/I20231221-0400/testresults/html/org.eclipse.compare.tests_ep431I-unit-macM1-java17_macosx.cocoa.aarch64_17.html

/labelContributionData/file1.java

java.io.FileNotFoundException: /labelContributionData/file1.java
at org.eclipse.osgi.storage.url.bundleentry.Handler.findBundleEntry(Handler.java:55)
at org.eclipse.osgi.storage.url.BundleResourceHandler.openConnection(BundleResourceHandler.java:182)
at java.base/java.net.URL.openConnection(URL.java:1094)
at java.base/java.net.URL.openStream(URL.java:1161)
at org.eclipse.compare.tests.TextMergeViewerTest.testToolbarLabelContribution(TextMergeViewerTest.java:519)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)

I will push a fix.

@lathapatil
Copy link
Contributor

I will push a fix.

Thanks for the quick fix..

@iloveeclipse
Copy link
Member

lathapatil added a commit to lathapatil/www.eclipse.org-eclipse that referenced this issue Dec 31, 2023
iloveeclipse pushed a commit to eclipse-platform/www.eclipse.org-eclipse that referenced this issue Jan 4, 2024
Michael5601 pushed a commit to CodeLtDave/eclipse.platform that referenced this issue Feb 12, 2024
Michael5601 pushed a commit to CodeLtDave/eclipse.platform that referenced this issue Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants