Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329533 - Keywords is not highlighted in the "search view"
Summary: Keywords is not highlighted in the "search view"
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Search (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7 M4   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 343880 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-11-05 08:13 EDT by Eclipse_Keil CLA
Modified: 2011-04-26 12:02 EDT (History)
5 users (show)

See Also:


Attachments
File Search (94.26 KB, image/jpeg)
2010-11-05 08:13 EDT, Eclipse_Keil CLA
no flags Details
Conflict CDT - JDT (106.85 KB, image/jpeg)
2010-11-08 10:40 EST, Eclipse_Keil CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eclipse_Keil CLA 2010-11-05 08:13:28 EDT
Created attachment 182465 [details]
File Search

Dear all,

I've posted my problem to the forum but get no answer - after a year. 

http://www.eclipse.org/forums/index.php?t=msg&goto=637192&S=411a787b391ffc151ecd9eae7fa4aa58#msg_637192

I use "File Search" instead of "C/C++ Search", because "C/C++ Search" can't find all the entries, perheps due to the reason we use some Non-ANSI-C Standard keywords, i don't know, whatever.

"File Search" is cool, i can specify within which files to search - much better than CodwWright - which i used before.

Unfortunately, it doesn't highlight the keywords in "search view", as you can see in the attachment. "C/C++ Search" does. Peopel says it works by them, but not by me.

Thanks.

Mike

P.S.: This effect may be another naiv question for you guys, but it has bothered me for a really long time. :(
Comment 1 Markus Keller CLA 2010-11-05 10:44:55 EDT
The File Search is language-agnostic, so you won't get any syntax coloring in the Search view.

But highlighting of the matched characters works for File Search. Just make sure you have "Preferences > General > Appearance > Use mixed fonts and colors for labels" checked.
Comment 2 Eclipse_Keil CLA 2010-11-08 03:52:04 EST
Hi, Markus,

thanks again for your quick answer...:)

But it doesn't work...i've checked/unchecked/checked/unchecked this option for many times...but still i can't get them highlighted.

Regards,
Mike
Comment 3 Dani Megert CLA 2010-11-08 04:42:19 EST
I see the problem (ugly) when looking at the code: Search uses a color key which is contributed by JDT and I assume in your case JDT is not installed and hence the matches aren't highlighted because the color definition is not available.
Comment 4 Dani Megert CLA 2010-11-08 06:45:51 EST
Fixed in HEAD.
Available in builds >= N20101108-2000.


Mike, if you can't switch to the latest build, you can either add JDT to your install or add the following extension to any plugin.xml:
   <extension
      point="org.eclipse.ui.themes">
      <colorDefinition
            label="%coloredLabels.match_highlight.label"
            categoryId="org.eclipse.jdt.ui.presentation"
            value="206,204,247"
            id="org.eclipse.jdt.ui.ColoredLabels.match_highlight">
         <description>
            %coloredLabels.match_highlight.description
         </description>
      </colorDefinition>
   </extension>
Comment 5 Eclipse_Keil CLA 2010-11-08 10:40:52 EST
Created attachment 182626 [details]
Conflict CDT - JDT
Comment 6 Eclipse_Keil CLA 2010-11-08 10:41:35 EST
Hi Dani,

thanks for your help. In the solution you provided, something i can't figure out, :(

Solution 1: Where can i get N20101108-2000? What is it? Eclipse-Build or CDT-Build or JDT-Build?

Solution 2: Add JDT? I've already CDT installed, as i tried to install JDT, i got the error as in attachment.

Solution 3: Add extension. I tried add this extension into C:\Programme\eclipse-cpp-helios-win32\eclipse\plugins\org.eclipse.platform_3.6.0.v201006080911\plugin.xml. But it doesn't help.

Regards,
Mike



(In reply to comment #4)
> Fixed in HEAD.
> Available in builds >= N20101108-2000.
> 
> 
> Mike, if you can't switch to the latest build, you can either add JDT to your
> install or add the following extension to any plugin.xml:
>    <extension
>       point="org.eclipse.ui.themes">
>       <colorDefinition
>             label="%coloredLabels.match_highlight.label"
>             categoryId="org.eclipse.jdt.ui.presentation"
>             value="206,204,247"
>             id="org.eclipse.jdt.ui.ColoredLabels.match_highlight">
>          <description>
>             %coloredLabels.match_highlight.description
>          </description>
>       </colorDefinition>
>    </extension>
Comment 7 Dani Megert CLA 2010-11-08 10:54:54 EST
>Solution 1: Where can i get N20101108-2000? What is it? Eclipse-Build or
>CDT-Build or JDT-Build?
This is a nightly build for 3.7 which will be produced tonight. It's the Eclipse SDK which contains JDT but not CDT.

>Solution 2: Add JDT? I've already CDT installed, as i tried to install JDT, i
>got the error as in attachment.
Strange. Maybe you mixed versions? You should use the install manager (Help > Install New Software...) to add JDT.

I guess for you the simplest fix is to paste the extension into one of the plugin.xml files.
Comment 8 Dani Megert CLA 2010-11-08 10:58:33 EST
>Maybe you mixed versions?
Not 100% sure but it looks like you tried to mix 3.6.0 with 3.6.1.
Comment 9 Markus Keller CLA 2010-11-08 12:29:06 EST
> Solution 3: Add extension. I tried add this extension into
> C:\Programme\eclipse-cpp-helios-win32\eclipse\plugins\org.eclipse.platform_3.6.0.v201006080911\plugin.xml.
> But it doesn't help.

You probably have to start once with -clean on the command line to refresh the extension registry.

Or it failed because the categoryId could not be found. Please try this (should show up on the "Colors and Fonts" preference page in the "Basic" category):

   <extension
      point="org.eclipse.ui.themes">
      <colorDefinition
            label="Colored labels - match highlight"
            categoryId="org.eclipse.ui.workbenchMisc"
            value="206,204,247"
            id="org.eclipse.jdt.ui.ColoredLabels.match_highlight">
         <description>
            The background color used to highlight matches in the Search view when colored labels are enabled.
         </description>
      </colorDefinition>
   </extension>
Comment 10 Eclipse_Keil CLA 2010-11-08 12:51:34 EST
I am so...............oo happy, yes, it works now!

Hug, hug, cheer, cheer

Many thanks to Dani, to Markus...
Comment 11 Dani Megert CLA 2010-11-09 03:07:07 EST
> Or it failed because the categoryId could not be found. Please try this 
FYI:
categoryId - the optional id of the themeElementCategory this color belongs to.
;-)
Comment 12 Dani Megert CLA 2010-12-07 07:23:53 EST
Verified in I20101206-1800.
Comment 13 Dani Megert CLA 2011-04-26 12:02:15 EDT
*** Bug 343880 has been marked as a duplicate of this bug. ***