NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Code Completion: traits used in classes


Joined: 25 Aug 2012
Posts: 1
Reply with quote
Hello,

It would be great to make code completion recognize traits used in classes. Screenshot:
http://oi47.tinypic.com/20g03ki.jpg
Code completion window should show Fields(), InnerJoin() and LeftOuterJoin().

Regards,
l280270
View user's profileFind all posts by l280270Send private message


Joined: 11 Jun 2007
Posts: 16
Reply with quote
Seconded for this feature.
View user's profileFind all posts by GreenFedoraSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
Planned for v8.1

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 11 May 2008
Posts: 78
Reply with quote
I would say it's a shame traits code completion was not implemented in 8.1!
What's worse, code completion is totally broken for classes that make use of traits.
Consider the following code, the last line not only doesn't list trt, but it throws an error dialog box "Item not found". The result is the same even without the artificial conflict resolution block in the class. The parser is "5.3 and higher".
Official PHP 5.4 came out in March 2012, with betas back in June 2011.
I suupose v9.0 is far away..

In 8.0 at least traits were ignored and the rest of the class was code-completed as before.

Code:
<?php
namespace test3;

trait tr1 {
   public function trtest1() {
      echo "tr1::trtest1()<br>";
   }
}

class class1 {
   use tr1 { tr1::trtest1 as trt;}
   
   public function c1test() {
      echo 'class1::c1test()<br>';
   }
}


$c = new class1();
$c->


Edit: It seems the namespace declaration breaks the code completion here.
I guess this should be filed as a bug.. of course after at least another one confirms this is a bug (I might have overlooked something).

Edit2: It's clearly a bug - After each closing of the IDE when such an error dialog was "invoked" on a failed code completion, then when starting the program again, it pops up a warning everytime that the IDE crashed last time it was closed.
I's become kind of a habit, with every major or submajor update lately there are many new and annoying bugs introduced, mainly relating to code completion reliability. 8.1 is not an exception. Every now and then one gets stuck in his/her work with another update that's buggy enough to make this happen. Come on, test more before releasing, please. The product is expensive enough to drop the testing phase to such lows. One is left with no choice but to adopt some version that is stable enough and not update until some major pain gets in the way with some new PHP version etc.

I wonder, is the bug feedback in the forums taken into consideration or is just ignored by the devs (because "not the right place to report")? Many people don't reach that far to report a bug in the Contact Us page, they just look for help in the forums.
View user's profileFind all posts by tedychSend private message


Joined: 18 May 2006
Posts: 61
Reply with quote
Traits completion should work in latest build of PHPEd 8.1. Please check.
View user's profileFind all posts by mdegtyarevSend private message


Joined: 06 Aug 2007
Posts: 13
Reply with quote
Hello,
but code completion still doesn't work on trait properties (PhpEd 16.0, build 16063).
In the example below "$this->page->" suggests nothing. And Ctrl+Click on "$this->page" also does nothing.
Code:
class html {
    public function render() {}   
}

trait trait_html {
    /** @var html */
    public $page;
}

class controller {
    use trait_html;
    public function index() {
        $this->page->???
    }
}
View user's profileFind all posts by shimasoftSend private message


Joined: 06 Aug 2007
Posts: 13
Reply with quote
Also Refactor > Rename doesn't work on trait properties, though both Refactoring and Code completion works correctly on trait methods.
View user's profileFind all posts by shimasoftSend private message


Joined: 06 Aug 2007
Posts: 13
Reply with quote
Still doesn't work. PhpEd 17.0 (Build 17016). Sad
View user's profileFind all posts by shimasoftSend private message


Joined: 06 Aug 2007
Posts: 13
Reply with quote
Fixed in PhpEd 18.0 (Build 18017). Very Happy
View user's profileFind all posts by shimasoftSend private message
Code Completion: traits used in classes
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic