Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPStorm exclude vendor from search but keep Intellisense

Tags:

phpstorm

Any idea how can I exclude the vendor directory from Search in files and folders but keep it in indexing for Intellisense purposes?

I need to search only in my Symfony files, not the framework and so on.

Tried Scopes in Settings, with this pattern:

!file[abuse]:vendor//*

Thank you!

like image 650
MariusP Avatar asked Jan 12 '16 15:01

MariusP


2 Answers

Scopes functionality is the way to go here.

You just need to ensure that you have inclusive parts as well and not exclude rules only. The solution is to include everything recursively and only then exclude unwanted stuff.

The reason for that -- ATM search does not correctly process scopes that have exclude rules only.

like image 83
LazyOne Avatar answered Sep 18 '22 12:09

LazyOne


I tried using scopes but it didn't seem to work for me. The vendor files still turned up when trying to open files (ctrl + shift + n) and in order to use the scope I had to manually select it from the find in all files dialog.

I better solution I found was using the composer settings in PhpStom as shown in this question.

Just add your composer.json and composer.phar into the composer settings and it does the rest for you!

like image 32
Yep_It's_Me Avatar answered Sep 19 '22 12:09

Yep_It's_Me