This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I was searching in bug tracker, but i didnt find similar one. When i would liked to use global variables in methods, the code completion is not worked. Example: $variable = new test; class some_class { public function some_method(test &$t) { global $variable; $variable->set_ref => here is the problem } } Version: Netbeans 6.5 stable
I tried hinting the cc with a docblock but that didn't help /** * * @global User $user */ public function something() { global $user; $user->{no suggestions from cc} // was not able to hint the CC via docblocks } it seems like being able to hint the cc via a @global docblock should do the trick... this works with @params extending it to work with @global would be cool. ... even tho globals are bad ;-)
reassigning to default owner
batch reassigning
Still reproducible in NB 7.0
This is more of a pain than P4. It stops code completion working for large chunks of some systems e.g. working with Moodle, the global $DB access object, $OUTPUT object and $PAGE object has no code completion, which significantly slows down learning the changes that have occurred to the API.
Fixed the case, when the global variable is defined in the same file as is use. So the onthefloorr's case is fixed. In other case you have to use the ways as phatduckk described, that now works as well. in web-main: http://hg.netbeans.org/web-main/rev/b525305c631a in release701: http://hg.netbeans.org/releases/rev/5b58d4d989c3
Integrated into 'main-golden', will be available in build *201105200400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/b525305c631a User: Petr Pisl <ppisl@netbeans.org> Log: #155085 - global variables and oop code completion problem
Product Version: NetBeans IDE 7.0.1 (Build 201107211357) Java: 1.7.0; Java HotSpot(TM) Client VM 21.0-b17 System: Linux version 2.6.38-10-generic running on i386; UTF-8; en_US (nb)