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 187161 - "After Field" formatting option does not work in PHP editor
Summary: "After Field" formatting option does not work in PHP editor
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal with 3 votes (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-03 18:55 UTC by pcdinh
Modified: 2011-06-08 14:20 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 pcdinh 2010-06-03 18:55:16 UTC
By setting "After Field" option, I expect that there will be blank lines between class properties. However, current implementation in Netbeans 6.9 does not work this way. Tested: Netbean 6.9 RC1, RC2 and latest build 1910 from http://bertram.netbeans.org/hudson/job/PHP-build/lastSuccessfulBuild/

Product Version: NetBeans IDE Dev (Build 2010-06-03_15-03-36 )
Java: 1.6.0_21-ea; Java HotSpot(TM) Client VM 17.0-b15
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\Pcdinh\.netbeans\dev

Choose Tools -> Options -> Editor -> Formatting -> Language: PHP - Category: Blank lines -> After Field: 1, Before Field: 0

Expected: The setting will help separate each field declaration by a blank line
Actual: No blank line inserted after the formatting

Sample code
===========

<?php

/**
 * Description of TestClass
 *
 * @author pcdinh
 */
class TestClass
{
    protected $_x;
    protected $_y;
    const A = 1;
    function doX()
    {
        
    }
}

?>

After being re-formatted
========================

<?php

/**
 * Description of TestClass
 *
 * @author pcdinh
 */
class TestClass
{
    protected $_x;
    protected $_y;
    const A = 1;
    function doX()
    {
        
    }
    <---- A new blank line inserted here and that's all (unexpected)
}

?>


Expected
========================

<?php

/**
 * Description of TestClass
 *
 * @author pcdinh
 */
class TestClass
{
    protected $_x;

    protected $_y;

    const A = 1;

    function doX()
    {
        
    }
}

?>
Comment 1 doldev 2010-11-30 13:25:08 UTC
Same happens under Linux. Must be somewhere a bug in the properties storage.

*** This bug has been marked as a duplicate of bug 186918 ***
Comment 2 alecsammon 2011-05-10 13:43:53 UTC
I'm using build 201105090000 and still experiencing this issue

==============================
Desired:

    /**
     * The name of the layout
     * @var string
     */
    private $layout;

    /**
     * The name of the view
     * @var string
     */
    private $view;

    /**
     * The subject
     * @var string
     */
    private $subject;


==============================
Actual:

    /**
     * The name of the layout
     * @var string
     */
    private $layout;
    /**
     * The name of the view
     * @var string
     */
    private $view;
    /**
     * The subject
     * @var string
     */
    private $subject;
Comment 3 Petr Pisl 2011-06-08 14:19:50 UTC
I have fixed this last week. The properties was renamed and new one for blank lines between fields was added.