This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 158921 - Block comments are incorrectly indented
Summary: Block comments are incorrectly indented
Status: RESOLVED DUPLICATE of bug 162320
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P3 blocker (vote)
Assignee: Tomasz Slota
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-20 23:41 UTC by blakenzoe
Modified: 2009-06-30 17:29 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description blakenzoe 2009-02-20 23:41:25 UTC
STR:

1) Open a PHP project and create a new PHP file.
2) Under Tools | Options | Editor | Code Templates, click the "fnc" template and edit it to look like the following:
/**
 * ${cursor}
 */ 
public function ${function_name}() 
{
    
}

3) Click OK, then close the Options window.
4) Add a new class "foo" to the PHP file.
5) In the class body, indent four spaces, type fnc and press the TAB key to expand the fnc template.  It should look
like the following:
    /**
 * 
 */ 
    public function function_name () {
        
    }

Notice the incorrectly-indented block comment.

If I replace the block comment with line comments in the "fnc" definition, the code expansion is correctly indented.
Comment 1 blakenzoe 2009-02-20 23:46:38 UTC
Clarification: I had my editor set to place the opening brace on the same line as the declaration, which is why the
braces also appear incorrectly formatted.  The brace formatting is by design and should be ignored; the issue is with
block comments only.
Comment 2 Tomasz Slota 2009-04-10 14:28:26 UTC
confirmed, this problem does not only relate to code templates, applying formatting on generated code also does now work

example code:

<?php
class class_name {
    function __construct() {
        ;
    }
    
    /**
 * 
 */ 
    public function function_name() {
    
    }
}
?>
Comment 3 Filip Zamboj 2009-06-30 12:49:02 UTC
@tslota: please, delete duplicate reference if you think it's not a duplicate of 162320

*** This issue has been marked as a duplicate of 162230 ***
Comment 4 Filip Zamboj 2009-06-30 12:53:24 UTC
sorry! I add wrong issue as duplicate
Comment 5 Filip Zamboj 2009-06-30 12:54:39 UTC

*** This issue has been marked as a duplicate of 162320 ***