Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322321 - Typing /**Enter does not apply the correct PHPDoc template
Summary: Typing /**Enter does not apply the correct PHPDoc template
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Zhongwei Zhao CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-11 03:59 EDT by Sylvia Tancheva CLA
Modified: 2020-05-14 11:07 EDT (History)
1 user (show)

See Also:


Attachments
patch (1.63 KB, patch)
2010-08-13 22:19 EDT, Zhongwei Zhao CLA
no flags Details | Diff
patch (2.17 KB, patch)
2010-10-15 00:22 EDT, xu jiaxi CLA
no flags Details | Diff
new patch (2.95 KB, patch)
2010-10-17 06:50 EDT, Zhongwei Zhao CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sylvia Tancheva CLA 2010-08-11 03:59:16 EDT
My template for methods looks like this:
/**
 * I just edited this template
 * ${cursor}${tags}
 */
Have the following code:
function doSomething(String $hello) {
        return true;
    }
Above the function start typing /**<Enter>
Result(wrong):
    /**
     *
     * Enter description here ...
     * @param $hello
     */
    function doSomething(String $hello) {
        return true;
    }
For the same function generate the PHPDoc by using Source -> Generate Element Comment. The result will be the following (correct):
    /**
     * I just edited this template
     * @param String $hello
     * @return boolean
     */
    function doSomething(String $hello) {
        return true;
    }

So it seems that typing /**Enter does not apply the correct template.
Comment 1 Zhongwei Zhao CLA 2010-08-13 22:19:19 EDT
Created attachment 176594 [details]
patch

workaround
Comment 2 Roy Ganor CLA 2010-08-15 05:21:53 EDT
(In reply to comment #1)
> Created an attachment (id=176594) [details]
> patch
> 
> workaround

what is exactly the problem that this workaround fixes? since there are several issues in this bug report...
Comment 3 Zhongwei Zhao CLA 2010-08-15 05:44:24 EDT
now the result of /**<Enter> is
    /**
     * |//cursor position
     * I just edited this template
     * @param unknown_type $hello
     */

after apply the patch:
the result of /**<Enter> is
    /**
     * |//cursor position
     * I just edited this template
     * @param String $hello
     * @return boolean
     */
Comment 4 Roy Ganor CLA 2010-08-15 16:12:22 EDT
ok, but any reason to "Thread.sleep()", this is the reason we have WAIT flag (that should work)

or?
Comment 5 Zhongwei Zhao CLA 2010-08-15 21:36:53 EDT
(In reply to comment #4)
> ok, but any reason to "Thread.sleep()", this is the reason we have WAIT flag
> (that should work)
> 
> or?

I hope it work,but it seems not,if it works this issue does not exist,I will have a look at WAIT flag and why it does not wait.
Comment 6 xu jiaxi CLA 2010-10-14 05:01:43 EDT
Hi zhao,
Has this bug been fixed in HEAD?
After typing /**<Enter>, I get the result below
/**
 * 
 * I just edited this template
 * @param unknown_type $hello
 */
Comment 7 Zhongwei Zhao CLA 2010-10-14 20:19:37 EDT
(In reply to comment #6)
> Hi zhao,
> Has this bug been fixed in HEAD?
no,please apply the patch,and then have a try:)
> After typing /**<Enter>, I get the result below
> /**
>  * 
>  * I just edited this template
>  * @param unknown_type $hello
>  */
Comment 8 xu jiaxi CLA 2010-10-15 00:22:19 EDT
Created attachment 180925 [details]
patch

Now we can get the correct ASTNode by using the method name instead of method offset.

But the return type is still incorrect, maybe this is another bug.
Comment 9 Zhongwei Zhao CLA 2010-10-17 06:50:10 EDT
Created attachment 181048 [details]
new patch

committed to head already
Comment 10 Zhongwei Zhao CLA 2011-04-27 01:46:19 EDT
change status
Comment 11 Sylvia Tancheva CLA 2011-07-13 10:16:18 EDT
When I try to generate comment by typing /** <Enter>, I get this:
/**
 * 
 * @param String $hello
 */	

When I generate it using Source -> Generate Element Comment, I get this:
/**
 * @param String $hello
 * @return boolean
 */

After editing the method comments, the changes applies in both comment generation types. Example:
/**
 * I just edited this template
 * @param String $hello
 * @return boolean
 */
	
	and

/**
 * 
 * I just edited this template
 * @param String $hello
 */	

But the difference remains. Reopen the issue.

Ilina Stefanova
Comment 12 Zhongwei Zhao CLA 2011-08-08 00:45:52 EDT
please try the latest build,thanks
Comment 13 Sylvia Tancheva CLA 2011-09-08 06:31:10 EDT
Verified. 
Ilina Stefanova