Community
Participate
Working Groups
Use code like this: <?php class CCC{ const xxx = 2; } CCC| Calling the Content Assist at | does nothing. If you type '::' then it suggests 'xxx'. Expected: To suggest/add '::xxx' CCC::xxx If there is a static member also, then the '::' is added automatically and a suggestion for both the static member and the constant is shown.
fixed in head and branch
I am not sure I understand this request (enhancement?). Eclipse doesn't usually suggest things like this. for example the following scenario doesn't behave as you mentioned and it is ok. class A { function foo() ) $a = new A(); $a| we don't complete the "->foo()" as "->" is a trigger that must be specified by the user. Am I missing something?
(In reply to comment #2) > I am not sure I understand this request (enhancement?). > Eclipse doesn't usually suggest things like this. for example the following > scenario doesn't behave as you mentioned and it is ok. > > class A { function foo() ) > $a = new A(); > $a| > > we don't complete the "->foo()" as "->" is a trigger that must be specified by > the user. > > Am I missing something? sure,for me it is wired,but it exists for a long time from I use pdt,so I have no idea about this.
and now we have to made much extra effort to judge if we should add "::".
The issue is that if you have a static member for example and you type CCC| <- ctrl+space you will get automatically CCC::<the_static_member> This works both for static fields and methods, but not for constants, even though they share the same syntax. In the given by Petyo example when typing CCC| <- ctrl+space you get nothing. But if you add to the code a static member for example: class CCC{ const xxx = 2; static $yyy; } and you type again CCC| <- ctrl+space then :: are added automatically and xxx and $yyy are suggested. So it seems that if you have only constants it is a kind of exception from the rule. Anyway it is minor bug.
(In reply to comment #5) > The issue is that if you have a static member for example and you type > CCC| <- ctrl+space > you will get automatically > CCC::<the_static_member> > This works both for static fields and methods, but not for constants, even > though they share the same syntax. > > In the given by Petyo example when typing > CCC| <- ctrl+space > you get nothing. > But if you add to the code a static member for example: > class CCC{ > const xxx = 2; > static $yyy; > } > and you type again > CCC| <- ctrl+space > then :: are added automatically and xxx and $yyy are suggested. > > So it seems that if you have only constants it is a kind of exception from the > rule. > > Anyway it is minor bug. Thanks,and I have fixed the minor bug,because it is easy to fix,hehe! But it seems that Roy does not like the way of adding "::".
;) well, I just think it's a minor issue and not sure if it's a slick behavior. anyway if it's the current behavior let's keep it as is. thanks for explaining this
Tested on 2.2.1.v20100829 Reproduced again.
Created attachment 178205 [details] patch
fixe
Tested on 2.2.1.v20101001 Fixed