Bug 325985 - PHP: Fully support namespaces
Summary: PHP: Fully support namespaces
Status: RESOLVED DUPLICATE of bug 255537
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: PHP (show other bugs)
Version: 4.5.1
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-14 02:07 UTC by Andrew Udvare
Modified: 2014-01-19 10:54 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Udvare 2013-10-14 02:07:27 UTC
The KDevelop PHP extension works well with code that makes no use of namespaces, but when namespaces are used, very few things work, especially across classes and using use statements.

In short, just like the C++ built-in plugin, support namespaces but also accept the as keyword in the use statement to resolve the same class.

<?php
namespace VendorName/SomeComponent;

use Doctrine\Collections\ArrayCollection;

class Puzzle extends ArrayCollection
{
}

Another file:
<?php
namespace VendorName/SomeComponent;

use SomeLibrary\Piece as TheirPieceImpl;

class Piece extends TheirPieceImpl
{
}

If another file does this:
use SomeLibrary\Piece;
use VendorName\SomeComponent\Puzzle;

$puzzle = new Puzzle();
$piece = new Piece('a');
$puzzle->addPiece($piece->(ctrl+space)); // expect method completion here

It would be acceptable if 2 classes were named the same entirely and found in the hierarchy that the first be the one to get methods and properties from. But the main goal here is that typing Puzzle() is treated the same as typing VendorName/SomeComponent\Puzzle() due to the use statement.

Reproducible: Always

Steps to Reproduce:
1. Open project that uses namespaces
2. Attempt to auto-complete a method with a class that is mentioned via use statement

Actual Results:  
Only Kate auto-completion results appear.

Expected Results:  
KDevelop's auto-complete results should appear (method names, properties, etc).
Comment 1 Heinz Wiesinger 2014-01-19 10:54:55 UTC

*** This bug has been marked as a duplicate of bug 255537 ***