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

Bug 324905

Summary: [Search] Show different colors to mark read and write accesses in Mark Occurrences
Product: [Tools] CDT Reporter: Patrick Hofer <paedu.hofer>
Component: cdt-editorAssignee: Anton Leherbauer <aleherb+eclipse>
Status: RESOLVED FIXED QA Contact: Anton Leherbauer <aleherb+eclipse>
Severity: enhancement    
Priority: P3    
Version: 7.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
proposed patch
none
updated patch aleherb+eclipse: iplog+

Description Patrick Hofer CLA 2010-09-09 17:02:02 EDT
Enhance the current "Mark occurrences" implementation to show write accesses in a different color as in JDT.

Patch is following.
Comment 1 Patrick Hofer CLA 2010-09-09 17:04:03 EDT
Created attachment 178567 [details]
proposed patch
Comment 2 Anton Leherbauer CLA 2010-09-15 08:47:39 EDT
Nice!
One problem I see is that we need to differentiate between C and C++ when determining the access type, i.e. use CPPVariableReadWriteFlags for ICPPVariables and CVariableReadWriteFlags otherwise.
Please also have a look at MarkOccurrenceTest in org.eclipse.cdt.ui.tests.  The patch makes some of the tests fail, because a few occurrences are mapped to the new annotation type.  This needs to be adjusted.
Comment 3 Patrick Hofer CLA 2010-09-16 03:04:15 EDT
Created attachment 178999 [details]
updated patch

Thanks for the feedback.
The updated patch should address the issues in comment#2. I took the chance to enhance the MarkOccurrenceTest to check the new markers as well.
Those tests run very slow btw. Any idea how to speed them up?
Comment 4 Anton Leherbauer CLA 2010-09-17 04:49:30 EDT
Great, I committed your patch to HEAD.  Thanks for contributing!
I believe the tests run slowly because they need to wait for the reconciler and for the post selection listener which are both delayed a few hundred ms.
Comment 5 CDT Genie CLA 2010-09-17 05:23:02 EDT
*** cdt cvs genie on behalf of aleherbau ***
Bug 324905 - [Search] Show different colors to mark read and write accesses in Mark Occurrences
Patch from Patrick Hofer

[*] CSearchMessages.properties 1.44 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchMessages.properties?root=Tools_Project&r1=1.43&r2=1.44
[*] IOccurrencesFinder.java 1.4 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/IOccurrencesFinder.java?root=Tools_Project&r1=1.3&r2=1.4
[*] OccurrencesFinder.java 1.8 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/OccurrencesFinder.java?root=Tools_Project&r1=1.7&r2=1.8
[*] CSearchMessages.java 1.16 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchMessages.java?root=Tools_Project&r1=1.15&r2=1.16

[*] CEditor.java 1.218 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java?root=Tools_Project&r1=1.217&r2=1.218

[*] plugin.properties 1.206 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.ui/plugin.properties?root=Tools_Project&r1=1.205&r2=1.206
[*] plugin.xml 1.388 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.ui/plugin.xml?root=Tools_Project&r1=1.387&r2=1.388

[*] occurrences.cpp 1.6 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.ui.tests/resources/ceditor/occurrences.cpp?root=Tools_Project&r1=1.5&r2=1.6

[*] MarkOccurrenceTest.java 1.13 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/MarkOccurrenceTest.java?root=Tools_Project&r1=1.12&r2=1.13