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

Bug 356587

Summary: toggle comment block
Product: z_Archived Reporter: G.M. <braker>
Component: PDTAssignee: PHP UI <php.ui-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: ganoro, silviya, zhaozhongwei
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description G.M. CLA 2011-09-02 09:11:16 EDT
Build Identifier: I20110613-1736

The Toggle-Comment function in PHP does not work as expected any more.

When i use (alt+shift+7)=(alt+/) or alt+shift+c - i can comment code-lines. This is a nice feature, but when i use comments to comment the sourcecode these will be uncommented. So the feature which worked in eclipse 3.0, 3.2 and 3.4 is now useless.

e.g. 

	// process tokenlist
	$tokenlist = array_map (
			function ($item) use ($lang){
			// Do some overengineered stuff, or whatever to ransform Tokens into something usefull
			return strtolower($item);
		},$tokenlist);

will become after toggeling:

	process tokenlist
// 	$tokenlist = array_map (
// 			function ($item) use ($lang){
				Do some overengineered stuff, or whatever to ransform Tokens into something usefull
// 				return strtolower($item);
// 			},$tokenlist);

but should be:

//	// process tokenlist
// 	$tokenlist = array_map (
// 			function ($item) use ($lang){
//				// Do some overengineered stuff, or whatever to ransform Tokens into something usefull
// 				return strtolower($item);
// 			},$tokenlist);


Reproducible: Always

Steps to Reproduce:
1. Write some PHP-Code with comments
2. Mark block to comment/uncomment
3. Toggle comments by using alt+shift+c
Comment 1 G.M. CLA 2011-09-10 06:32:37 EDT
I checked, whether it worked in PDT before, but i found out, that i used PHPEclipse before using PDT, so it is my fault that i assumed that it worked in PDT before.

PDT Version having this erroe is: 
PHP Development Tools (PDT) SDK Feature	3.0.0.v20110516-1100-77--84_23JBVgSVXO7XGJz0VLa9O	

I also want to correct the testcase since i gave the wrong keyboard shortcut.

Wrong:
Alt + Shift + C
Correct:
CRTL + Shift + C

Anyway, toggling a block, to comment or uncomment it is a feature
* which should analyse the block first
** Decide whether to comment or uncomment as a whole
* and this one decision should be applied to all lines, (add more comments, or remove comments)
* it must not be decided for each line 
* it must not uncomment indented comments
* it must be seen as a single transaction, not as a set of transactions.
Comment 2 Zhongwei Zhao CLA 2011-09-10 06:53:34 EDT
hi,

there is no such bug before eclipse 3.7,actually this is a wtp bug,we use its comment handler to deal with toggling comment block,and now I am trying to find a way to fix it,thanks for your report.
Comment 3 Zhongwei Zhao CLA 2011-09-14 10:53:22 EDT
fixed in head
Comment 4 Sylvia Tancheva CLA 2011-10-18 06:50:44 EDT
Verified.

Ilina Stefanova