Bug 337960 - [navigation] Occurrence highlighting visible in compare editor
Summary: [navigation] Occurrence highlighting visible in compare editor
Status: CLOSED DUPLICATE of bug 64911
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-23 06:26 EST by David Balažic CLA
Modified: 2011-02-23 13:34 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Balažic CLA 2011-02-23 06:26:40 EST
Build Identifier: 20100917-0705

When looking at changes (from the Team functionality, using subclipse plugin for SVN access) in Java code in the Java Source Compare Editor, some items (words) are highlighted, even if they are not changed between the compared versions of the document.

It turns out that it is the a "Mark Occurrences" feature from the regular Java editor.

This is a bit confusing, especially as it can not be controlled from the compare editor (placing the text cursor on a Java item does not make its occurrences highlighted, turning occurrence marking on/off with alt-shift-o does not work, neither is there an icon for it in the toolbar).

IMO, the occurrence marking should not be visible in compare.

Additional details:
 - the compare editor does not behave the same behavior if opened from Synchronize view by double-clicking on a changed file or when using the context menu Compare With / Base Revision on the opened file in Java Editor

 - The first shows the occurrences from a regular editor of the same file in sync. Whatever change is done in the editor (by moving the text cursor) to the highlighting, it is immediately visible in compare editor.
 - error in code are underlined by red in the compare editor
 - any text changes in the editor are visible in the compare editor

The Compare With... editor on the other hand does not sync to any changes made in the file editor. It also never show the red underlining of error.


So questions are:
 - what is with highlighting? Either they should not be visible in compare (my preference) or they should be fuly supported (turning on/off, selecting what to highlight, just like in regular editor)

 - what are there two different behaviors of Java Source Compare Editor (one updating to changes made in the compared file, the other being "static") ?
I recall there being requests for this "live update" and it being turned down as requiring too much CPU time.
See: bug 41564 , bug 176690


org.eclipse.compare 3.5.100.I20100526-0800
Subclipse (Required)	1.6.17	org.tigris.subversion.subclipse.feature.group

Reproducible: Always

Steps to Reproduce:
1. Open compare of changed java file in Team Synchronizing
2. Open the same file in java editor
3. highlight some occurrences in the java editor

Result: highlight visible in compare editor
Comment 1 Dani Megert CLA 2011-02-23 08:30:39 EST

*** This bug has been marked as a duplicate of bug 64911 ***
Comment 2 David Balažic CLA 2011-02-23 09:13:39 EST
I also noticed that sometimes two different items are highlighted in the same Java Source Editor. Is that the same underlying problem?

(example: a local variable and its occurrences are highlighted, while at the same time a method name and its references)
Comment 3 Dani Megert CLA 2011-02-23 10:12:02 EST
(In reply to comment #2)
> I also noticed that sometimes two different items are highlighted in the same
> Java Source Editor. Is that the same underlying problem?
Yes, if you have two editors open on the same file.
Comment 4 David Balažic CLA 2011-02-23 10:19:52 EST
Two source editors? Is that even possible?

I don't remember what I had.
It was a source editor and a compare editor and maybe something more. A new double click on the file in Project Explorer just switches focus to the existing source editor.
Comment 5 Markus Keller CLA 2011-02-23 13:34:38 EST
> Two source editors? Is that even possible?

See Window > New Editor

> I also noticed that sometimes two different items are highlighted in the same
> Java Source Editor. Is that the same underlying problem?

The second set of highlighting were probably search results (from a File or Java search). Implementation-wise, these are also annotations, so they are also subsumed under bug 64911.