Bug 108256 - [refactoring] [ltk] Refactoring preview does not correctly highlight 5.0 code
Summary: [refactoring] [ltk] Refactoring preview does not correctly highlight 5.0 code
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.2 RC1   Edit
Assignee: Dirk Baeumer CLA
QA Contact:
URL:
Whiteboard:
Keywords: polish
Depends on:
Blocks:
 
Reported: 2005-08-29 06:32 EDT by Tobias Widmer CLA
Modified: 2006-04-12 09:03 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Widmer CLA 2005-08-29 06:32:53 EDT
I20050823-0800

Steps to reproduce:
- Consider following 5.0 cu:

enum TEST { BLA, BLAH };

- Rename and do a preview
-> enum keyword is not correctly highlighted
Comment 1 Dirk Baeumer CLA 2005-08-29 06:55:16 EDT
Andre, can you please give me a hint how I can advise the compare viewer to use
1.5 syntax coloring. I looked at CompareViewerSwitchingPane and satalietes but
didn't find a way how to do this.
Comment 2 Dirk Baeumer CLA 2006-04-03 05:55:41 EDT
Pinging Andre...
Comment 3 Dirk Baeumer CLA 2006-04-03 10:22:29 EDT
The class that currently sets up the compare viewer for refactoring preview is ComparePreviewer
Comment 4 Michael Van Meekeren CLA 2006-04-06 16:34:26 EDT
any plans here for 3.2 as it is a polish item?
Comment 5 Dirk Baeumer CLA 2006-04-07 04:29:23 EDT
Andre is looking into it but we don't know yet how much work it will be and whether it will make it into RC1 or not.
Comment 6 Andre Weinand CLA 2006-04-11 19:28:30 EDT
Please note that this problem does not only occur in the refactoring preview, but in any Java Compare.
The problem is that the Java 5.0 highlighting of the SourceViewer is configured via an additional chained PreferenceStore that needs to track the corresponding JavaProject of the viewers input. The JavaMergeViewer lacked this additional PreferenceStore.

I've added code to the JavaMergeViewer that checks whether the left, right, or ancestor input of the ICompareInput implements an IResourceProvider. If yes, it tries to get the underlying IResource of the input and maps it to a IJavaProject. This is used to setup the PreferenceStore that configures the SourceViewer.

Dirk, now you only have to implement the IResourceProvider interface on the two sides of the previewer input.
Comment 7 Dirk Baeumer CLA 2006-04-12 09:03:23 EDT
Thanks Andre.

Fixed for RC1.