Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force IntelliJ to always search in "Whole Project"

I like to use the Find in Path function CTRL+SHIFT+F, that searches for text strings in several files.

One thing I often run into though, is that I search for something that I know exists in at least one file, I get zero results or I find just some of the files that contain the search term.

Then I realise that the Scope setting in the Find Dialog box has been set to Module or Directory for some reason rather that "Whole project" which is what I almost always want.

What fools me here is that this only seems to happen occasionally - often I'll have the scope set to Whole project like I want to, but sometimes it will be something else.

How does IntelliJ decide which scope to use?

Also, is there some setting that can be used to force IntelliJ to always select "Whole project" as the default?

like image 470
TV's Frank Avatar asked Jun 04 '12 13:06

TV's Frank


People also ask

How do I refresh my IntelliJ workspace?

Do one of the following: To run Standard Refresh, click the Refresh toolbar button. or press Ctrl+F5 . To run Force Refresh, click the Force Refresh toolbar button.

Where is build path in IntelliJ?

Open the Project Structure dialog (File | Project Structure Ctrl+Alt+Shift+S ). In Project Settings, select Project and in the Project compiler output field, specify the corresponding path. For modules, select Modules, the module you need and the Paths tab.

What does build project do in IntelliJ?

In IntelliJ IDEA, a project helps you organize your source code, tests, libraries that you use, build instructions, and your personal settings in a single unit. Launch IntelliJ IDEA. If the Welcome screen opens, click New Project. Otherwise, from the main menu, select File | New Project.


2 Answers

Just collapse the project tab before: Command + 1 or Alt + 1

The default selection depends on the context which launched the search. If you have the project tab open with a folder/file selected it will search in that folder or the parent of that file.

To search by default just close that panel (this will make the context be the whole project) and press the search shortcut and it will be scope properly.

like image 146
Mihai Toader Avatar answered Oct 14 '22 03:10

Mihai Toader


Not really a solution, but how to avoid using the mouse for this:

When the dialog is open, press Alth before pressing enter. This will cause the scope to be set to Whole project.

like image 3
robinst Avatar answered Oct 14 '22 03:10

robinst