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 172475 - Some templates incorrectly formatted/indented
Summary: Some templates incorrectly formatted/indented
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-17 13:41 UTC by Tomas Mysik
Modified: 2016-06-10 11:47 UTC (History)
1 user (show)

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 Tomas Mysik 2009-09-17 13:41:23 UTC
Please, be sure that you use new templates from issue #171533 (currently fixed locally, will push tomorrow).
These templates are incorrect:

elif:
if (condition) {
    
}"elif" + TAB here   -> "elseif" is on a new line, not on this line

swi:
switch ($variable) {
    case value:
                       // <- cursor at incorrect position
        break;
    
    default:
        break;
}

tryc:
try {
    
} 
catch (Exception $exc) {        // <- incorrect formatting ("catch" should be on the same line with "}")
}

Product Version: NetBeans IDE Dev (Build 090917)
Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01
System: Linux version 2.6.28-15-generic running on amd64; UTF-8; cs_CZ (nb)
Comment 1 Filip Zamboj 2009-10-27 13:38:29 UTC
moving user case from 173906 that doesn't belong to 173906 here

code: 
<?php
try {
  
} catch(Exception $e) {
  
}
?>

is formatted like: 
<?php
try {
  
} 
catch(Exception $e) {
  
}
?>
Comment 2 Tomasz Slota 2009-10-27 14:25:41 UTC
Fixed all the use cases except the 'switch' template, which has a different nature. A clean fix would probably involve a change in the AST parser. I would 
consider to add ; to the template instead.

Downgrading back to P3

http://hg.netbeans.org/web-main/rev/cc849368204b
Comment 3 Quality Engineering 2009-10-28 11:31:54 UTC
Integrated into 'main-golden', will be available in build *200910280201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/cc849368204b
User: Tomasz Slota <tslota@netbeans.org>
Log: #172475: Some templates incorrectly formatted/indented
Comment 4 Quality Engineering 2009-10-30 10:59:59 UTC
Integrated into 'main-golden', will be available in build *200910300201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d2ddb5603afb
User: Filip Zamboj <fzamboj@netbeans.org>
Log: qa #173906 and #172475 are stable now
Comment 5 Tomasz Slota 2010-02-04 10:11:56 UTC
ppisl is the new owner of formatting/indentation area
Comment 6 Petr Pisl 2010-05-06 16:11:30 UTC
Still the problem with the switch template.
Comment 7 Petr Pisl 2011-06-08 11:59:07 UTC
Reproducible in NB 7.0 as well (the switch template)
Comment 8 Ondrej Brejla 2011-10-27 08:45:46 UTC
Still reproducible
Comment 9 Tomas Mysik 2016-06-10 11:47:46 UTC
Most cases fixed -> P4.