This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When I use grep (Linux, command line), I can specify –A n to show ‘n’ lines after the match; similary I can specify –B n to show ‘n’ lines before the match. It’s possible to consider add this feature to the search feature of NetBeans, because when I’m searching for something in an annotation, the annotation itself is useless for me. For example, if I search for “FetchType.EAGER” it brings me all occurrences of FechType.EAGER; then I have to open each file and search again for the term to discover where it’s. If I can specify –A 1 or –A 3 (or have a option for “Show ‘n’ lines after match”, I’ll see (and be able to “double-click”) the line that have the real information I need. Thanks, Edson.
A possible solution is to use the tooltip baloon to show a code block from few lines before and few lines after (configurable?). Having a default of at least 3 before and 3 after would help already. Regards, Edson
We'll discuss it for the next release. But it can be difficult, because some users might find the tooltip obtrusive. Finding the optimal number of surrounding lines is not trivial. Why do you think 3 is appropriate? Did you try navigating with Ctrl+Comma and Ctrl+Period in the editor. Then you can see the whole file. I usually use it when I need to see the context of matching lines. Kind regards, and thanks for reporting.
The tooltip already exists, and is completely useless: it indicates the line and column of the match. Would be much more useful if it shows the block of code surrounding the match. Regarding the magic number 3, actually is based on my guess (and experience: 90% of time, I'm interested in one or two lines above and below the match). Regards, Edson
(In reply to comment #3) > The tooltip already exists, and is completely useless: Probably, some users in forums claimed that it should be removed completely. > Would be much more useful if it shows the block of code surrounding > the match. Yes, the question is whether it is better to have nothing, or even bigger pop-up. Thank you.
(In reply to comment #4) > (In reply to comment #3) > > The tooltip already exists, and is completely useless: > Probably, some users in forums claimed that it should be removed completely. It can be easily solved by a "enabled/disabled" option, as well the number of shown lines "before" and "after". > > > Would be much more useful if it shows the block of code surrounding > > the match. > Yes, the question is whether it is better to have nothing, or even > bigger pop-up. In my case, a bigger popup would save me a lot of opened editors (you can imagine I'm looking for CascadeType annotation in a project with 1000 persistent java classes, and having to open each one to check if they are related or not the what I'm looking for). > > Thank you.
(In reply to comment #4) > (In reply to comment #3) > > The tooltip already exists, and is completely useless: > Probably, some users in forums claimed that it should be removed completely. http://hg.netbeans.org/core-main/rev/e738ab1e42f8 The tool tip was removed. > In my case, a bigger popup would save me a lot of opened editors (you can > imagine I'm looking for CascadeType annotation in a project with 1000 > persistent java classes, and having to open each one to check if they are > related or not the what I'm looking for). It might be added in the next release.
Integrated into 'main-golden', will be available in build *201211240959* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/e738ab1e42f8 User: Jaroslav Havlin <jhavlin@netbeans.org> Log: #202628: Removing useless tooltip from text detail node in Search Results window
(In reply to comment #1) > A possible solution is to use the tooltip baloon to show a code block from few > lines before and few lines after (configurable?). Having a default of at least > 3 before and 3 after would help already. I've implemented this solution. http://hg.netbeans.org/core-main/rev/1dd7928c4418 It's not configurable (yet), I think 3 lines before and after should be sufficient. Thank you very much for reporting and for your comments!
Integrated into 'main-golden', will be available in build *201302222300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/1dd7928c4418 User: Jaroslav Havlin <jhavlin@netbeans.org> Log: #202628: Search results - show surrounding lines in text detail tooltip