Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 322796

Summary: Defined constants are not autocompleted within class method
Product: z_Archived Reporter: post
Component: PDTAssignee: PHP Core <php.core-inbox>
Status: CLOSED WORKSFORME QA Contact: Ilina Stefanova <ilina.s>
Severity: normal    
Priority: P1 CC: ganoro, kalin.a, petyo_tanchev, post, zhaozhongwei
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
Video of the problem none

Description post CLA 2010-08-16 10:49:58 EDT
Created attachment 176679 [details]
Video of the problem

Hi All,

I am quite new with eclipse PDT, and I must say, I love it! I just found 1 item which I think is a small bug. I did some searching in Google and this site, but I can't find anything about it.

The problem.

I have some constants defined in my bootstrap.php file. These constants are correctly auto completed in my whole project, but only if I am in the "main body" of a PHP file. If I move my cursor in a class, then the auto complete will not show me the constant. 

Is this a bug? I think so. 

So, example:

bootstrap.php
<?php

define('MY_DEFINED_CONSTANT_HERE', 123 );

// here some code

?>

TestClass.php
<?php

define('ANOTHER_DEFINE', 345) ;

// if I type here MY_D, then the autocomplete DOES work!

class TestClass
{
    public function myMethod()
    {
        // if I type here MY_D, then it DOES NOT work!
        // if I type ANOTH, then that constant is visible.
    }
}

?>

If I define the constant in the file itself, it does work. 
The file TestClass is loaded by an AutoLoader, thus not by a "include".

I have set the PHP version to 5.3 within my project settings, but this makes no difference. Default it runs wit PHP 5.1/5.2.

I have tried to make a video of it with my webcam, but its very blurry. Hope it helps though...
Comment 1 post CLA 2010-08-16 11:03:14 EDT
Oh, I forgot to mention that the PHP constants like  PHP_EOL or CURLOPT* constants are also not available.
Comment 2 Zhongwei Zhao CLA 2010-08-17 05:00:53 EDT
I think this bug has been fixed in head already,it is duplicate of Bug 264442.
Comment 3 Petyo Tanchev CLA 2010-09-01 10:09:56 EDT
Tested on 2.2.1.v20100829
Still reproducible.
Comment 4 xu jiaxi CLA 2010-10-19 03:27:24 EDT
Hi zhao, is this bug fixed already?
Comment 5 Zhongwei Zhao CLA 2011-06-24 11:51:17 EDT
Could not reproduce it.
Comment 6 Kalin CLA 2011-08-02 04:19:14 EDT
Verified.
Closing...