Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can phpstorm suggest variables from included files?

I have included some files in my php script using include and I am using variables and functions defined in my included files. Is there any way to configure PhpStorm in such way to show this kind of variables in the suggestions list?

like image 439
Cornelia Secelean Avatar asked May 12 '13 15:05

Cornelia Secelean


1 Answers

Edit Dec 2021: (version 2021.2.3): option is now called "Search for variable's definition outside the current file"

Edit Jan 2021: (version 2020.1.1): option is now called "Report in files containing include statements"

Make sure the "Ignore 'include' and 'require' statements" option is unchecked in the Editor > Inspections > Undefined Variable. After doing this you will have auto-complete variables.

Undefined Variable PHPStorm

Annoyingly this doesn't give you type information about those variables, even if they're defined with accompanying PHPDoc.

like image 186
Juddling Avatar answered Sep 21 '22 21:09

Juddling