Is it possible to exclude certain files from the TODO function in PhpStorm? For example, I'm using the highcharts javascript library. I don't want to see the few dozen or so TODO's they have marked mixed in with my own. I don't want to exclude this directory, because I still want to be able to view the files in a convenient manner.
Asked
Active
Viewed 9,336 times
4 Answers
42
- In
File > Settings > Scope
add a new scope and make sure the files you like are green. - Open TODO Tab
View > Tool Windows > TODO
(Alt + 6) - In the top of TODOs click on
Scope Based
- Below select your new scope from step 1 below
Custom Local Scopes

PiTheNumber
- 22,828
- 17
- 107
- 180
-
2This is wright solution! All others are incorrect. Thank you. – user1954544 May 08 '17 at 20:06
-
This is the idiomatic solution, ignore the others. This should be accepted as the correct solution. – Oct 05 '17 at 16:59
-
this was really helpful. – nipunasudha Sep 10 '18 at 18:58
41
Yes, you can -- via custom scope that would include all but unwanted files/folders (Settings | Scopes) and then just choose it in TODO window.
Check these articles for details:
- http://blog.jetbrains.com/webide/2012/10/managing-todo/
- http://confluence.jetbrains.com/display/PhpStorm/Working+with+todo+comments+and+the+todo+tool+window
P.S.
This functionality is available since v6 only.

LazyOne
- 158,824
- 45
- 388
- 391
5
For libraries, there is a one click solution as I have just found out.
You can use the "External Libraries" feature to include the specific library folder, after which PHPStorm / IDEA will mark the folder as a library home and exclude it from inspection.
Note that you can include folders inside your project directroy, even though it's called "External" Libraries.

Michael Yoo
- 489
- 1
- 6
- 14
-
How do you add directories inside the project to External Libraries? – Jesse Schoff Oct 22 '14 at 17:50
-
1@Mute Right click on External Libraries -> Select Configure PHP Include Paths -> Add the directory of the library you wish to exclude in the "Include path" section. The reason I said that internal folders are also exclude-able with this feature is because the vendors folder, which is a third party library folder, resides under the project root. Also, the reason I don't just mark the folder excluded is because if I exclude it, PHPStorm essentially treats them like text which means namespaces etc. inside the folder are not detected. – Michael Yoo Oct 31 '14 at 08:13
-
1It seems that in the latest version of PHPStorm (2016.2.2), the folders within a project have to be excluded to be registered as External Library. This thankfully is automatically done by PHPStorm. So: 1. Mark folder as Excluded 2. Add folder to External Libraries – Michael Yoo Nov 13 '16 at 12:16
5
To exclude code (usually composer dependencies) from analysis.
- Right click on desired folder
- Click 'Mark Directory As'
- Click 'Excluded'
Screenshot example below:

Eddie Jaoude
- 1,698
- 15
- 23
-
4But as I've explained in my other comment, doing this will cause PHPStorm to stop ALL inspections - not just TODOs. This means PHPStorm will essentially treat the files as not being there at all. So that means no more autocomplete and also Namespace not detected warnings everywhere etc. – Michael Yoo Oct 31 '14 at 08:22
-
1Will this exclude the folders from all operations (esp VCS) or just inspections? – Oct 03 '16 at 20:48
-