There is a way to search for type or method declarations or references, using Search > Java in Eclipse. But, what about specifying some more advanced searching criteria, for example:
I've been working on a very large codebase, and having these kinds of queries would help immensely. Browsing the Eclipse Marketplace, closest thing I could find is SEA-QL, but it does not even manage to create an index of all the projects in the workspace.
Any suggestions?
If you want to search in files: Ctrl + H and then choose tab File Search . If you want to search for resources: Ctrl + Shift + R . If you want to search for Java types: Ctrl + Shift + T . If you want more shortcut keys: Ctrl + Shift + L .
The Eclipse search dialog box allows you to search for files that contain a literal or a character pattern in the entire workspace, a set of projects, a specific project or folders selects in the package explorer view. Clicking on the Search menu and selecting Search or File or Java. Clicking Ctrl + H.
Ctrl+H opens the search dialog which you can use to search for packages. Show activity on this post. Click on the root package and start typing the name of the package you are looking for.
Use the built-in Eclipse Search dialog. The Search menu contains multiple items (Search→ Search, Search→ File, Search→ Help, and Search→ Java), but all of them open the same dialog.
What you're asking for sounds wonderful to me - I don't know of any built in functionality that will easily give what you're asking for. Perhaps someone will suggest a plugin.
However, have you considered a combination of: - "Working Sets" - Regular Expressions - Saved searches
to help alleviate some pain?
A suggestion for your second example: Create a "working set" containing the com.foo.* packages Do a "File" (not Java) search with the Regular Expressions option checked, searching in files of type *.java, for something like:
implements.*I.*\R.*insert
You could make the regex more or less explicit depending on the method signature of the "insert" method.
Saving the searches would allow you to build up (and share) a library of frequently used expressions.
I hacked this example from another SO question and some blogs: Useful regex for Eclipse searching and Eclipse Regex find and replacing amongst others.
You'd also have the added benefit of brushing up on your Regex skills (something I know I need to do myself!)
Incidentally, what source control platform are you using? There are search tools (think Google) available that you can plug in to some source control systems. For example, I use this tool: SVN Query and I'm sure there are others. This also isn't a clean solution to what you're asking. Sorry I don't have a straight answer! Hope someone has a useful suggestion!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With