| Summary: | Constants defined in A.php file are not present in code assist in file B.php | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Vitaly <vitalik.perekhoden> |
| Component: | PDT | Assignee: | PHP UI <php.ui-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P1 | CC: | ganoro, jacek.pospychala, pavel.galaton, petyo_tanchev, qiangsheng.w, vitalik.perekhoden, zhaozhongwei |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
did you include file A.php in file B.php, if not - do you think we should list all constants in all files? (potential performance issue?) (In reply to comment #1) > did you include file A.php in file B.php, if not - do you think we should list > all constants in all files? > > (potential performance issue?) If file A.php is included, the problem is also reproducible. In Eclipse Galileo PDT everything is working fine (constants were shown) I have a question:
File A.php
$aa="";
File B.php
class Test{
private $var = $a| //code assist doesn't shows $aa
}
Is this a bug too?And there are many other cases(global classes...) like this.
(In reply to comment #3) > Is this a bug too?And there are many other cases(global classes...) like this. for me it looks so. That's the point of global stuff - it should be visible everywhere :-( However, different cases may be fixed as separate bugs.. fixed in head (In reply to comment #4) > (In reply to comment #3) > > Is this a bug too?And there are many other cases(global classes...) like this. > > for me it looks so. That's the point of global stuff - it should be visible > everywhere :-( > However, different cases may be fixed as separate bugs.. but this is not a (syntax) valid php execution: <?php $aa = 5; class A { private $v = $aa; } $a = new A(); echo $a->v; so why should we provide it? (In reply to comment #6) > (In reply to comment #4) > > (In reply to comment #3) > > > Is this a bug too?And there are many other cases(global classes...) like this. > > > > for me it looks so. That's the point of global stuff - it should be visible > > everywhere :-( > > However, different cases may be fixed as separate bugs.. > > but this is not a (syntax) valid php execution: > > <?php > > $aa = 5; > class A { > private $v = $aa; > } > > $a = new A(); > echo $a->v; > > > > so why should we provide it? Hi Roy Yes,I just knew it is not valid.Sorry for this. But I did not provide for global variables. I just fix the global constant issue. So,can we mark this bug as fixed again? I think there's more issue of the CA for constant. 1. create a class with a method 2. try CA for DIR| -> constants are not proposed 3. try outside the class - works as expected I think the fixing in GlobalConstantsStrategy.java for 300530 caused this issue and going to do more changes in the GlobalConstantsStrategy.java. (In reply to comment #8) > I think there's more issue of the CA for constant. > > 1. create a class with a method > 2. try CA for DIR| -> constants are not proposed > 3. try outside the class - works as expected > > I think the fixing in GlobalConstantsStrategy.java for 300530 caused this issue > and going to do more changes in the GlobalConstantsStrategy.java. <?php define("DIR", ""); class class_name { function function_name() { DI| // DIR proposed as expected in my devenv } } ?> Oh,sorry My fixing code is just workaround:) I'm talking about the DIRECTORY_SEPARATOR from the standard.php. DIRECTORY_SEPARATOR is proposed too,but do not mention it,go ahead! Well not sure if you're using the latest code. Did you change anything in the GlobalConstantsStrategy.java? Hi,
I also have some problems with AC constants.
Example:
created file test.php
<?php
define('TEST_CONST', 'test_value');
when typing here `echo TES` nothing appears (in CA window were only standard php constants), ctrl+space don't help also.
but if I type `echo` press ctrl+space and then type TEST it shows me TEST_CONST in CA window as expected.
Build id: 20100617-1415
with installed pdt-Update-N201007152113
PHP version for project containing file test.php : PHP 5.1/5.2
(In reply to comment #14) > Hi, > I also have some problems with AC constants. > Example: > created file test.php > <?php > define('TEST_CONST', 'test_value'); > when typing here `echo TES` nothing appears (in CA window were only standard > php constants), ctrl+space don't help also. > but if I type `echo` press ctrl+space and then type TEST it shows me TEST_CONST > in CA window as expected. > > Build id: 20100617-1415 > with installed pdt-Update-N201007152113 > PHP version for project containing file test.php : PHP 5.1/5.2 same problem with PHP 5.3 <?php const TEST_CONST = 12; start typing `TEST_` nothing shows, ctrl+space and then type `TEST_` works. really annoying, hope soon will be fixed (In reply to comment #15) > (In reply to comment #14) > > Hi, > > I also have some problems with AC constants. > > Example: > > created file test.php > > <?php > > define('TEST_CONST', 'test_value'); > > when typing here `echo TES` nothing appears (in CA window were only standard > > php constants), ctrl+space don't help also. > > but if I type `echo` press ctrl+space and then type TEST it shows me > TEST_CONST > > in CA window as expected. > > > > Build id: 20100617-1415 > > with installed pdt-Update-N201007152113 > > PHP version for project containing file test.php : PHP 5.1/5.2 > > same problem with PHP 5.3 > <?php > const TEST_CONST = 12; > start typing `TEST_` nothing shows, > ctrl+space and then type `TEST_` works. > > really annoying, hope soon will be fixed Ah...it seems that I could not reproduce this:( Ooops sorry, my bad, file test.php i created was outside of buid path, thats why it wasnt working.
By the way shouldn't it show me global constants in this file, even if it is outside build path?
steps to reproduce:
1) create project
2) go to properties of project -> PHP Build Path -> Select project folder and Remove it -> OK
3) create new file `test.php` in root of project with source:
<?php
define('TEST_VAR', 'test');
4) start writing TEST_VAR and you will see that no AC,
Same thing with variables,
Thing that i note is when you first press ctrl+space you can find your TEST_VAR in list, but it is marked with green bullet and little "F" on this bullet, instead of normal triangle that marks constants
screen showing this : http://j.imagehost.org/0952/screen.png
Hi Pavel the original bug has been fixed,and about you last comment we have not supported it.If you would like please open another bug for it marking as enhancement,thanks! Tested on 2.2.1.v20100829 Fixed |
Build Identifier: 20100617-1415 File A.php define ('LW_DB_PASSWORD', ''); define ('LW_DB_SERVER', 'localhost'); File B.php class Test{ private $var = LW | code assist doesn't shows defined constants } Reproducible: Always