How to disable/configure scopes in Find in Path

I really like PhpStorm, but I find the default behaviour of Find in Path very annoying and it's slowly driving me crazy.

This is what happens:
- Open Find in Path
- Select "Whole project" (if not already selected)
- Search for something
(DON'T click on the results, let's say that you got too many matches and you want to try a different search)
- Open Find in Path

and... PhpStorm will select the directory of the first result as a scope of your new search.
(this doesn't happen if you open at least one of the results. I think there are also other cases where this happens or doesn't happen, because I keep bumping into it and I'm reasonably sure it's not always this way)

I'm not sure if this is a "smart" feature or a bug (I'm tempted to say a bug, because I really don't see the logic behind selecting a result I DID NOT click as the scope of my new search), but it keeps getting in my way. Basically it forces me to select "Whole project" every time I open Find in Path (another annoying thing it that sometimes it selects the root of the project as "Directory", which means that it's basically searching in the whole project but it's not obvious unless you inspect the path).
When I forget to do it I often get no results and it forces me to search again.

How do I fix this?
- The best solution would be to disable this "smart select" feature
- If that's not possible I would be happy to disable the "Directory" scope all together (because for the way our code base is structured I rarely need to restrict the search to a particular folder)

Thanks :)

3 comments

Giacomo,
Find in Path sets its scope based on the context.

  • If you invoke Find in Path when the focus is in the editor, it will set the scope to the "Whole project".
  • If you invoke it when a directory is selected in the Project view, it will set the scope to the selected directory.
Could you please vote for the issue IDEA-87037?
0

Hi Giacomo,

It's a feature -- the pre-selected scope depends on where you have initiated the "Find in Path" dialog from. If from Editor -- it will be "Whole project" by default, if Project View or Search Results panel then it will be that specific folder (the folder with file currently being selected).

http://youtrack.jetbrains.com/issue/IDEA-87037

P.S.
You can jump to Editor area from anywhere by pressing Esc.

0

Thank you for your answers, now I have a better understanding of the problem.

Find in Path inherit the scope from the active "section", the problem is that after you execute a search the focus is automatically set to the first result, and the first result becomes the scope.

I see how it is a feature, but it's pretty broken IMHO. I'm going to upvote the issue and add my opinion in there, and I'll use 'esc' before any search for the moment.

Thanks again.

0

Please sign in to leave a comment.