| Summary: | Eclipse PDT should use namespaces for hinting | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Timo A. Hummel <privat> |
| Component: | PDT | Assignee: | PHP Core <php.core-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | glen.84, ilina.s, joker806, silviya, zhaozhongwei |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
fixed in head This code works:
<?php
class Test {
/**
* This is just a test.
* @return bar\Test The test class
*/
public static function getInstance() {
return new Test;
}
}
type here Test and call the CA and it works, but when add namespace like this:
<?php
namespace foo;
use bar\Test;
class Test {
/**
* This is just a test.
* @return bar\Test The test class
*/
public static function getInstance() {
return new Test;
}
}
and here type the Test and call the CA - nothing happens.
Reopen.
hi, When I comment this line,it works use bar\Test; After using that line,there should be a bar\Test class/namespace,and then the Test refers to bar\Test instead of foo\Test So I think this is not a bug. Verified. Closing |
Working example: <?php namespace foo; use bar\Test; class Test { /** * This is just a test. * @return bar\Test The test class */ public static function getInstance() { return new Test; } } ?> Then type "Test::getInstance()->" and it shows the methods of bar\Test. This one doesn't: <?php namespace foo; use bar\Test; class Test { /** * This is just a test. * @return Test The test class */ public static function getInstance() { return new Test; } } ?> Then type "Test::getInstance()->" and itdoesn't show the methods of bar\Test. The latter should work, since we're using "use bar\Test;" and it should be obvious to PDT that we mean bar\Test, even though we only refer to the alias name. If this isn't possible for some reason, it would be pretty good if Eclipse would show a warning that it can't resolve "@return Test" when hinting, e.g. when typing "Test::getInstance()->" it should complain that it can't resolve "@return Test", telling the user in which file the phpdoc hint is probably wrong. -- Configuration Details -- Product: Eclipse 1.3.0.20100617-0520 (org.eclipse.epp.package.php.product) Installed Features: org.eclipse.platform 3.6.0.v20100602-9gF78GpqFt6trOGhL60z0oEx3fz-JKNwxPY