How to disable indexing for cetrain directories? Follow
Please sign in to leave a comment.
Settings|Directories -> Use Exclude button on folder
Thank you so much!
I'd really love to find a way to exclude directories from the inspector without having to exclude them from the project as a whole. (read: PEAR installations, 3rd party libraries, etc.)
So far, I haven't been able to find that option.
There is a way which will fall under "as a whole" definition:
1) Remove such folder (if present) from Project in Settings | Directories (mark folder as excluded)
2) Add such folder in Settings | PHP
Such folders now will still be displayed in Project view: not under Project root but under External Libraries instead. As a result you still have code completion, but Search/Refactor/TODO/Inspections will not apply to such files. This is perfect (specially designed) for 3rd party libraries (like PEAR, Zend, Smarty etc)
One word: Scopes!!! This is one of my favorite features of PHPStorm. We have a HUGE project and many of the files are interdependent, and Scopes all me to view and process only those related to certain applications within the project....AND you can Inspect on them. I created a scope for my project, because we have some third party files (like prototype.js) that we don't want scanned.
And how would you do it before PHPStorm starts (from the commandline or by editing the config file)? Why do I ask? Well the application starts indexing right from the start so it would be convenient if you can exclude folders before it starts.
Create an empty new project, add 1 empty folder. Now perform those steps (remove from on replace add to another). Close project, go to .idea subfolder and open PROJECTNAME.iml file -- see the structure and replicate it in a similar way in your real project.
Alternatively, in your real project, temporarily make those problematic folders empty (move all files/subfolders elsewhere), launch PhpStorm and mark required directories accordingly. Then move all files back.
Yes -- far from perfect and easy solution. But it works. And if you are really strugling this should help.
This is probably the most inconvenient thing on InteliJ products.
Its not only on PHPStorm, its also a problem on Webstorm and all others in the family.
Doing the exclusion on the package level as instructed by Alexey Gopachenko does not work.
Doing what Andriy Bazanov also does not work as is almost same as alexey tip.
Keith Davis is talking about something else, and his explanation is confusing, I don't get it at all.
Second tip from Andriy Bazanov is not valid, I'm not paying a enterprise product to have to edit config files by hand.
Where is the official answer for this? Its really annoying problem and there is no "official" answer that works on the entire web. :|
Kirill's post starts off with "disable indexing", but then states that the issue is during "recompiling templates" which can be restricted to recompile within a scope, and has nothing to do with the indexing process.
We have a project with probably need 25000 files and indexing is not an issue for us.
So if the issue is compilation being too slow, the scope can be restricted, but if the issue is just reindexing period, that's a whole different problem and I'm not sure what solution would work.
So you want to exclude files from being indexed, but not from being accessible by the IDE? I'm confused.
Alexey's answer is official, actually. He is the team lead.
Could you please describe how exactly it doesn't work? Are the files still being indexed after you set them as Excluded?
I build a 'js-dev' directory with require.js into a 'js' directory. It causes massive duplicate code completion and was the cause of some memory and performance issues I was having during reindexing after each build.
After I exclude 'js' from the project, I no longer have issues and, of course, no duplicate code completion.
However, I lose deployment of that directory. Adding a separate 'js' directory mapping in deployment regains the loss of that feature.
This works for my case, but it would be convenient to exclude from indexing without having to lose other "in project" features. If it's possible to do this with scopes, please explain.
> This works for my case, but it would be convenient to exclude from indexing without having to lose other "in project" features. If it's possible to do this with scopes, please explain.
Unfortunately, it's not. Almost every single IDE feature relies on indices.
I think it would be a good idea to allow pausing the indexing.
For me, while it is indexing I am able to go into settings, but I am not able to add excluded files or set the scope. I am likely missing something, but I was thinking that if it is still indexing then there is not yet an available context for the directories to exclude or set the scope - if it uses the indexing to do that.
It seems the previous suggestion works, and for the next project set up I can consider that.
Phpstorm 2017.2 indexes windows/system32 directory and it's not inside my project.
So: Settings|Directories -> Use Exclude button on folder is absolute noncens.
>Phpstorm 2017.2 indexes windows/system32 directory and it's not inside my project.
1) 2017.1.2 is the latest stable version. 2017.2 is not yet available to the public in any form.
2) Please show what you have in "Settings | Languages & Frameworks | PHP --> Include paths"
It's possible that you have "." entry. If you do -- please remove and see if it will help.
But then .. you are on Windows and this should only affect Mac/Linux users only (I would think)
3) The only other possible thing I could think of -- you may have some symlink in your project (or folder that is referenced in your project -- e.g. external library) that leads to such folder. Or maybe it's referenced via some composer.json or alike file?
In any case: "windows/system32" is a very unusual and unexpected location to be indexed.
If nothing -- backup your PROJECT/.idea folder (this project settings) and delete it (while IDE is closed, of course). Then just use "Open" from Welcome screen and point to the project root folder -- IDE will create new project from existing files.
The "." in my include paths made the difference... You just made my day a lot better :-)
Yes, your right. I'm using 2017.1.2. Sorry for that...
I have to say that because of indexing I have to use Visual Studio Code. I hate that I cannot use my favorite IDE because of this one issue. And, why does it bother to index until I even set what directories should be? And can it ignore node_modules by default? We all have to use Visual Studio now because we have a hide shared module application and it is otherwise unable to start up unless I gave it all day to index. Actually I tried that a few times, but it never finished.
Drew, another way of temporary disabling indexing is File | Power Save Mode.
I had this problem in 2017.1 because my first include directory was "." - not sure where that came from, but it changed location depending on how I started PhpStorm, I think previously this was assumed to be project root, but it certainly isn't for PhpStorm 2017.1.4 (build #PS-171.4694.2)
AJ Lewis, it's been a bug, fixed already: https://youtrack.jetbrains.com/issue/WI-34845
I don't understand how can I disable folders by mask? And info at the top is outdated. Now you can disable folders for indexing within Project Structure window under Modules section.
@Slogic10 There's no option to exclude folders by mask - you need to mark them as excluded via right click > Mark As > Excluded or from Settings/Preferences | Directories.
Oddly enough, I just encounted the same Sys32 inclusion issue that Roger encountered. Very strange since that dir was & has never been included as a lib in any of my projects. I'm running 2017.2.4.
"Settings|Directories -> Use Exclude button on folder"
This is a lie.
Because the folder/file needs to exist before it's excluded, if you exclude it you wont benefit from the code help but your IDE will be unusable during the indexing that WILL happen no matter what.
Opichou, since 2017.2 you can exclude directories before they were created by using a pattern.
Also, indexing can be stopped at any moment by File | Power Save Mode.
@keith Thank you for the tip about scopes; this seemed to help me resolve a lot of the duplicate class definitions caused by composer creating a symlink to a a sub-repo included in the project ... just created a scope and explicitly added everything I wanted.
Settings|Directories is not an option in my IntelliJ IDE
IntelliJ IDEA 2017.3.4 (Ultimate Edition)
Build #IU-173.4548.28, built on January 29, 2018
IntelliJ IDEA has more complicated settings as compared to PhpStorm -- it can have multiple modules while PhpStorm project can only consist of a single module of specific type (WEB_MODULE).
Therefore you should look at Module/Project settings rather than general IDE Settings (sorry, not IntelliJ user so cannot be more specific).
As alternative -- try right clicking on a folder in Project View panel and use "Mark Directory as" submenu.
Ho about not indexing directories that are ignored in `.gitignore`? You could also have something like `.pycharmignore` and use it? That way the indexing will not even start, otherwise a huge directory freezes PyCharm long enough that "Right Click/Exclude" will be impossible (while indexing)
Actually there is an issue for it:
Beep. This is driving me insane. I have symlinks to HUGE resources directories and Idea is FREEZINg while "indexing". I have raised this as a separate issue elsewhere I believe as well as "PINGED" similar open issues. Here was one that was closed. https://intellij-support.jetbrains.com/hc/en-us/community/posts/207671405-stop-Indexing-please-
Seriously, guys!!!!!!!!! Fix this. How hard can it be to NOT index .gitignore entries and/or symlinks and/or directories as "ignored".
I can NOT use your product.