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

Bug 323233

Summary: Changing the Syntax Coloring for Constants does a huge mess
Product: z_Archived Reporter: Sylvia Tancheva <silviya>
Component: PDTAssignee: Zhongwei Zhao <zhaozhongwei>
Status: CLOSED FIXED QA Contact:
Severity: critical    
Priority: P1 CC: gadi, ganoro, ilina.s, qiangsheng.w, silviya
Version: unspecifiedFlags: ganoro: review+
qiangsheng.w: review+
zhaozhongwei: review? (zhaozhongwei)
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
screen-shot
none
New screen-shot
none
Screen-shot 30.08.2010
none
patch
none
patch
none
patch
none
patch none

Description Sylvia Tancheva CLA 2010-08-20 07:22:26 EDT
Created attachment 177081 [details]
screen-shot

Using the same code in the Sample (bellow) - just go to Preferences -> PHP -> Editor -> Syntax Coloring -> Constants and change it (I put orange colors). Apply and OK. the result is quite astonishing - see the screen-shot

<?php
define ( 'TEST', "" );
echo $GLOBALS ['test'];
echo __LINE__;
function test($test) {
	return false;
}
/**
 * @deprecated
 */
class Foo extends ReflectionClass implements FOO\IBar {
	const E_ERROR = 45;
	var $test;
	public static $my_static = 'foo';
	public function test($test) {
		return $this->test;
	}
	public static function foo() {
		return false;
	}
}
$text = <<<HEREDOC
	Hello, World!
HEREDOC;

/**
 * Sample function
 * @throws Exception
 */
function foo() {
	if (func_num_args () != 1) {
		throw new Exception ( "Illegal number of arguments" );
	}
	// TODO: do something
	$args = func_get_args ();
	print "{$args[0]}\n";
}
Comment 1 Sylvia Tancheva CLA 2010-08-20 09:16:27 EDT
Created attachment 177088 [details]
New screen-shot

Something similar happens when changing Normal - it looks even worse (see new screen-shot) because I accidentally changed also background color :-)
Yet I see that classes, functions, methods, constants, etc. are marked.
But background color shows that also in some places white spaces are colored as well, which I would not be able to see if I did not change the background color.
Comment 2 Zhongwei Zhao CLA 2010-08-26 08:14:48 EDT
fixed in head and branch
Comment 3 Gadi Goldbarg CLA 2010-08-30 06:57:10 EDT
[Petyo Tanchev]

Tested on 2.2.1.v20100829

About the constants - see the new attachment.
define() should be colored as a function, not as a constant.
The name inside the define - 'TEST' should be colored as a constant.
The screen-shot is made after pressing the Apply button. 

About the second Silviya's issue with the NORMAL background. It is still the same.
Comment 4 Gadi Goldbarg CLA 2010-08-30 06:58:12 EDT
Created attachment 177715 [details]
Screen-shot 30.08.2010
Comment 5 Zhongwei Zhao CLA 2010-09-01 02:28:46 EDT
About the second Silviya's issue with the NORMAL background. It is still the same.there is another bug for this Bug 323242.
Comment 6 Zhongwei Zhao CLA 2010-09-01 02:34:43 EDT
Created attachment 177917 [details]
patch
Comment 7 Zhongwei Zhao CLA 2010-09-02 04:08:39 EDT
Created attachment 178022 [details]
patch
Comment 8 Zhongwei Zhao CLA 2010-09-02 11:02:48 EDT
Created attachment 178050 [details]
patch
Comment 9 Zhongwei Zhao CLA 2010-09-02 11:09:39 EDT
Created attachment 178052 [details]
patch

new patch with test file updates
Comment 10 Roy Ganor CLA 2010-09-03 18:03:27 EDT
+1

thanks!
Comment 11 Roy Ganor CLA 2010-09-06 04:30:21 EDT
fixed by Zhao!
Comment 12 Sylvia Tancheva CLA 2011-07-15 07:43:47 EDT
Verified on Windows XP, 32 bit, with Zend Studio 9.0.0, build 179