Variable autocomplete sources entire project? |
Guru master
|
I'm thinking you imagined that. What would be the use of having autocompletion that only shows things from the current file? Start from a blank file and you have no autocompletion at all?
PhpED does keep the scope of the variable in my afaik. So it will only show variables that could be reached from that place in your code. But it has always been like that iirc. There is an option that says "Limit scope to includes" in the Code Insight > Settings entry under the Options, perhaps that is something that you had turned on before and that got turned off again when you upgraded? |
||||||||||||
|
|
Well ... for variables like $test that were used in a file somewhere else in the site .... yes. At the moment, when I go to enter a variable in a blank file, I get a dropdown showing all of these. It looks like every variable that I have used *anywhere*. I'll try setting that option and see if it brings things back in line for me, but the current behavior is a pain. Cheers |
||||||||||||||
|
Site Admin
|
Well, it's a php mudule-less paradigm. It does not support scopes other than objects (and namespaces starting with forthcoming 5.3). Indeed, even if you have absolutely no includes, it does not mean that your file is not included into the other files. If it is included, it will see all the variabels of the other files and from the files being included into them. Say you have file B which is included into A and A also includes C. The fact that B is included into A is enough to have all variables from A and C accessible in B even though B has no includes at all.
It works this way because PHP does not link the modules, it just make them merged and it does this in run-time. The problem easily gets complicated if you have auto-loaded modules (by the class name for example) and finally you may have some files names "calculated" for the include (for example "mymessages_{$LANG}.inc". As far as I know, there are no tools that may resolve the include statements with such constructs automacially. So, there are two choises: 1) forget about visibility for the global variables and make code completion working as if they are visible from everywhere. 2) track all include statements and manually resolve all includes non-resolved by the IDE. First way is followed by default. To make the IDE working by the 2nd way, you have to a) turn on "Limit scope to includes" in Tools->Settings->Code Insight, settings. b) make resolved all the entries on Project properties->Includes tab. |
||||||||||||
_________________ The PHP IDE team |
Variable autocomplete sources entire project? |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by