Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 371075

Summary: use statement is added on wrong possition
Product: z_Archived Reporter: Kalin <kalin.a>
Component: PDTAssignee: PHP Core <php.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: silviya, zhaozhongwei, zulus
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Kalin CLA 2012-02-09 08:31:10 EST
<?php
namespace NN;
class CCC {
	
}

class DDD extends C| //<--invoke content assist at cursor position "|", then select "CCC"

Actual:
<?php
use NN\CCC;

namespace NN;
class CCC {
	
}

class DDD extends CCC


Expected:
<?php
namespace NN;
class CCC {
	
}

use NN\CCC;

class DDD extends CCC
Comment 1 Zhongwei Zhao CLA 2012-03-19 03:45:46 EDT
fixed
Comment 2 Sylvia Tancheva CLA 2012-07-06 11:01:09 EDT
Current situation:
No use statement added at all.
Actual:
<?php
namespace NN;
class CCC {

}

class DDD extends CCC;

Reopen
Ilina Stefanova
Comment 3 Dawid Pakula CLA 2015-05-27 14:52:08 EDT
No use statement is correct behavior (like in JDT). 

Both classes are in same namespace, use statement isn't necessary.
Comment 4 Sylvia Tancheva CLA 2015-06-01 07:50:11 EDT
Right! Both examples from Ilina and Kalin are not really correct.
Previously it was adding a use statement which is not just at wrong position but not at all needed.
Closing the bug