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.

Bug 174699 - [Type]code completion regression from 6.7 to 6.8M2 [fields]
Summary: [Type]code completion regression from 6.7 to 6.8M2 [fields]
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: rmatous
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-15 21:02 UTC by andyr123
Modified: 2010-05-03 12:34 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andyr123 2009-10-15 21:02:36 UTC
Hi, In 6.7 the following code could code complete at the marked place. I would expect 'y()' to be completed. In 6.8M2 it
is no longer possible. Only observation I can make is that in 6.7 the 'a' in $this->a = new x(); is highlighted green,
whereas in 6.8M2 it is black. Not sure if that's a clue or not.

<?php
class x
{
  function y() {

  }
}

class foo
{
  public function bar()
  {
    $this->a = new x();
    $this->a->**code complete here**
  }
}
Comment 1 andyr123 2009-10-15 21:04:40 UTC
Just to note, adding:

/**
 * @var x
 */
public $a;

to class foo allows code completion to work.
Comment 2 rmatous 2009-10-16 11:13:40 UTC
Magic property $a should be documented this way:
/**
 * @property x $a
 */
class foo {

then CC in NB works properly.

For non magic property is this declaration(without $var) enough:
public $a;

to work CC in NB 


=> P3 
Comment 3 andyr123 2009-10-16 13:02:14 UTC
Hi, thanks for the response. In 6.7 the autocomplete would work ok without any phpdoc comments - are you saying this is
a change for 6.8 where all properties must now be documented with phpdoc for code completion to work?
Comment 4 rmatous 2009-10-16 13:25:42 UTC
I'm going to look at it and fix it but I think P3 is more appropriate here. Anyway thanks for the report
Comment 5 andyr123 2009-10-16 13:42:03 UTC
ok thanks - the reason it's important to me is the new symfony framework support. In a symfony action it is typical to
just to set $this->varname without a phpdoc definition as they are just passed to the template.
Comment 6 rmatous 2009-10-16 13:47:20 UTC
adding CC tomas who is responsible for symfony, thanks for this comment

Tomas, please be informed that this issue is related to symfony support (you can review the priority)
Comment 7 Tomas Mysik 2009-10-19 11:53:21 UTC
> ok thanks - the reason it's important to me is the new symfony framework support. In a symfony action it is
> typical to just to set $this->varname without a phpdoc definition as they are just passed to the template.

Sorry, this is out of scope for Symfony framework for NB 6.8. It is planned for the next release. Currently, only
$sf_user, $sf_request and $sf_response variables are available in a Symfony template.
Comment 8 andyr123 2009-10-19 14:30:05 UTC
Hi, thanks for response. I understand that the variable won't be code completed in the template (though that would be
fantastic if it could!), however it is quite common for me to do:

$this->variable = new Whatever();
foreach ($this->variable->getSomething() as $x) {
 // etc
}

in an action. Obviously this doesn't just affect symfony, but i would say it's common in an action to not phpdoc all the
properties (then used as a variable in the template), which may differ from 'best practice'.

Still, the priority is up to you guys, though it did use to work in 6.7.
Comment 10 Filip Zamboj 2010-05-03 12:34:34 UTC
Product Version: NetBeans IDE Dev (Build 100503-2daaf2ae8a4f)
Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01

verified