Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get line previews in Eclipse's context intelligent 'Java Search' (vs. context unaware 'File Search')

When using the search functionality in Eclipse, especially, for example, a Java method or field, the 'reference in workspace'. (Control+Shift+G) when the the cursor is on some method, say.

How do you have the search results show you the one line preview. (Think -- like every other search tool I've used can offer, from grep to Visual Studio?)

If I search on 'bit of text' (without the benefit of the scope parsing provided by the 'references' search, it offers it), but can't seem to figure out how when search for references.?

(Which, for, say, some class variables like public double x, is just absolutely critically useful vs. the sea of false listing that come up searching on something like 'x ')

//////////////////////////////////////////////////////

Clarifying my question by example:

In the screen shot1 attached, there are 111 references to the method getHeight(). But, without pop-pop-pop, jumping from entry to entry to entry, there's no way to see them?


Screenshot A: Screenshot A
( not letting me include directly due to some weird, kinda dumb annoying, account restriction thing...)


Whereas, if I search ( in the workspace) for getHeight() using "File Search" as 'raw text' (case filtered, and filtering for *.java) note seeing now 560 matches, or 449 "false positives" relative to the scope I'm actually interested in. Yet, see how the Search dialog view now at least! (yeah). Offers me the quick "line preview" of each entry.


. And screenshot B here:
screenshot B.


How do I get the line preview offered in screenshot B, but for those 111 matches (the ones I care about in this example) in the 'scope filtering' search 'Java Search' tab in the 'Search' dialog box?

/////////////////////////////////////////////

I've looked and looked, tried extensions, dug through preferences settings, and can't seem to figure out how to 'enable' that line preview for searches where it's "Limited To" 'References'

like image 356
Matt S. Avatar asked Jan 25 '11 20:01

Matt S.


1 Answers

As far as I know, the Eclipse Java Development Tools (JDT) still (2017!) do not offer such a “one line” or “one expression” preview. There is a third-party plug-in, however, that has this feature: Ctrlflow Code Search Professional.

This screenshot from its manual shows you how the results would look like:

Different levels of detail when presenting search results

Note that this is a commercial plug-in (and I am one of its developers). It has a free trial, however.

like image 50
Andreas Sewe Avatar answered Sep 19 '22 23:09

Andreas Sewe