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

Bug 314824

Summary: New templated 'Content Assist': optional parameters are included in the template
Product: z_Archived Reporter: Ilya Sedlovsky <purebill>
Component: PDTAssignee: PHP Core <php.core-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: gadi, ganoro
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Ilya Sedlovsky CLA 2010-05-28 04:49:48 EDT
Build Identifier: 20100520-1308

When a method of any class is inserted using code assist the list of all parameters of the method is present in the template of the method to fill them regardless of the fact some of them are optional (has default values) for the method and may not be present in the method call.

Reproducible: Always

Steps to Reproduce:
1. Create new PHP file and fill it with:
<?php
class Test {
    public function test($mandatory, $optional = null) {}
}

$test = new Test();
$test->
?>

2. Put your text cursor after "$test->" and press Ctrl+Space (invoke Code Assist).

3. PDT inserts template:
  $test->test($mandatory, $optional)

Note that $optional parameter has default value and must not be present in the template.
Comment 1 Roy Ganor CLA 2010-05-28 17:13:01 EDT
duplicate (original is fixed)

*** This bug has been marked as a duplicate of bug 309297 ***
Comment 2 Zhongwei Zhao CLA 2010-05-28 23:07:37 EDT
I tested it use the pdt product,and I can reproduce it,but it does not exist in devenv.And I have written a pdtt file to test it.Maybe it will works in the next version,but I am not sure!
Comment 3 Gadi Goldbarg CLA 2010-06-17 08:24:32 EDT
Verified at PDT-2.2.0.v20100616
Auto completion is suggested only mandatory function parameters
This issue is fixed
Closing
Thanks

Verified by
Teodor Kirkov
teodor.k@zend.com