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 240242 - PHP - PHP Trait - No Autocomplete on $this within a PHP Trait
Summary: PHP - PHP Trait - No Autocomplete on $this within a PHP Trait
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-10 17:22 UTC by berridgeab
Modified: 2014-01-30 17:17 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (60.07 KB, text/plain)
2014-01-10 17:22 UTC, berridgeab
Details

Note You need to log in before you can comment on or make changes to this bug.
Description berridgeab 2014-01-10 17:22:40 UTC
Product Version = NetBeans IDE 7.4 (Build 201310111528)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.7.0_25
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.25-b01

Hi

When trying to use $this-> within the context of a PHP trait, there is no auto-complete of its already defined functions and variables.

A trait is not a class, however it is still able to use standard class keywords such as $this-> as a trait will eventually be used by a class.

Sorry if this is a duplicate bug report, I did search for a similar bug report.

To reproduce the bug follow the instructions below.

1. Create a new empty PHP file.

2. Copy and paste the below code: - 

<?php
trait foo
{
	protected $bar;
	
	public function getBar()
	{
		return $this->bar;
	}

	public function setBar($bar)
	{
		$this->bar = $bar;
		
		//Try using autocomplete here, it should suggest both functions and the $bar but it has no suggestions.
		$this->
	}
}
?>

Thanks!

Regards
Andrew
Comment 1 berridgeab 2014-01-10 17:22:57 UTC
Created attachment 143813 [details]
IDE log
Comment 2 Tomas Mysik 2014-01-13 09:52:35 UTC
Ondro? Thanks.
Comment 3 Ondrej Brejla 2014-01-13 15:36:30 UTC
Reproducible.
Comment 4 Ondrej Brejla 2014-01-14 10:10:38 UTC
Fixed in web-main #9bc4812330ac
Comment 5 mmolda 2014-01-30 17:17:06 UTC
Verified. Thanks.

Product Version: NetBeans IDE Dev (Build 201401300001)
Java: 1.8.0; Java HotSpot(TM) 64-Bit Server VM 25.0-b67
Runtime: Java(TM) SE Runtime Environment 1.8.0-b126
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)