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 194300 - Code completion suggestion error if constructor present
Summary: Code completion suggestion error if constructor present
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.0
Hardware: PC Windows 7 x64
: P2 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-13 12:27 UTC by Raazy
Modified: 2011-01-17 16:28 UTC (History)
0 users

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 Raazy 2011-01-13 12:27:11 UTC
Today I ran to a strange behavior in Code suggestion.


Repeat steps:

1)Create empty PHP project or use any existing
2)Create new PHP file
3)Paste following code into editor and save it.
------snip-------------------
<?php


class test {

	function __construct() {
	}

	public function start($param) {
		$aa = $this->loadclass1();
		$aa->;

		$bb = $this->loadclass2();
		$bb->;
	}

	/**
	 * @return ClassName 
	 */
	private function loadclass1() {
		return new ClassName();
	}

	private function loadclass2() {
		return new ClassName;
	}

}

class ClassName {
	function aa() {}
	function bb() {}
	function cc() {}
}
------snip-------------------
4) Goto line 11 at statement $aa-> (or line 14 at $bb->)
5) Try to invoke code completer;it says "No suggestion"
5a) If code completion works, try to add an empty line anywhere and do 5) again, until it says "No suggestion"

6)Now try remove ctor function (or comment it out, or even rename it to something else, eq. __constructer )
7)Do 5) again, and now it works as expected
8)restore ctor, and try 5); again "No suggestion"


Version tested:



OK
Product Version: NetBeans IDE 6.9 (Build 201006101454)
Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15
System: Windows Vista version 6.1 running on x86; Cp1250; cs_CZ (nb)


OK
Product Version: NetBeans IDE 6.9.1 (Build 201007282301)
Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15
System: Windows Vista version 6.1 running on x86; Cp1250; cs_CZ (nb)


OK
Product Version: NetBeans IDE 7.0 Beta (Build 201011152355)
Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15
System: Windows Vista version 6.1 running on x86; Cp1250; cs_CZ (nb)



OK
Product Version: NetBeans IDE Dev (Build 2010-09-06_21-44-04 )
Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15
System: Windows Vista version 6.1 running on x86; Cp1250; cs_CZ (nb)
Userdir: C:\Users\zradek\.netbeans\dev


FAIL
Product Version: NetBeans IDE Dev (Build 2011-01-13_03-03-33 )
Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15
System: Windows Vista version 6.1 running on x86; Cp1250; cs_CZ (nb)
Comment 1 Petr Pisl 2011-01-17 14:42:29 UTC
Reproducible, even the $aa is not visible in cc, when the constructor is there.
Comment 2 Petr Pisl 2011-01-17 16:14:07 UTC
It's regression => increase the priority P2
Comment 3 Petr Pisl 2011-01-17 16:28:49 UTC
Fixed in webmain.