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 268710

Summary: Excessive empty lines added between docblock comments and function declaration when there is preceding inline comment
Product: php Reporter: josef.sabl
Component: Formatting & IndentationAssignee: junichi11
Status: RESOLVED FIXED    
Severity: normal CC: junichi11, tmysik
Priority: P3    
Version: 8.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: My formatting settings.

Description josef.sabl 2016-10-27 11:01:04 UTC
Created attachment 162657 [details]
My formatting settings.

Expected autoformatting:

class MyClass
{

	public $foo; //this is foo

	/**
	 * This is bar
	 */
	public function bar()
	{

	}
}


Actual autoformatting:

class MyClass
{

	public $foo; //this is foo

	/**
	 * This is bar
	 */


	public function bar()
	{

	}
}

Sometimes there is one excessive line, sometime more.

My formatting settings are attached.
Comment 1 junichi11 2016-11-19 04:22:13 UTC
It's reproducible in 8.1, 8.2, dev.

It seems that the cause is a comment part. I'll try looking at it.

Thanks for reporting!
Comment 2 junichi11 2016-11-20 04:50:39 UTC
I'll fix it.

BTW, I found another issue (Reformat the below code).
But probably, we can fix it and this issue at the same time.

Code:========================================
<?php

class MyClass {

    // comment
    public $foo; // comment
    // comment
    public $bar;

    /**
     * comment
     */
    public function bar() {
        
    }

}

Actual:========================================
<?php

class MyClass {

    // comment
    public $foo; // comment
    // comment

    public $bar;

    /**
     * comment
     */
    public function bar() {
        
    }

}


Expected:========================================
<?php

class MyClass {

    // comment
    public $foo; // comment

    // comment
    public $bar;

    /**
     * comment
     */
    public function bar() {
        
    }

}


Formatting Options:
- Blank Lines
    "Group Fields without PHP Doc" uncheck
    "Before Fields" 1
    "Between Fields" 1
    "After Fields" 1

Thanks.
Comment 3 junichi11 2016-11-24 01:58:38 UTC
Fixed.

http://hg.netbeans.org/web-main/rev/dc79aaf6d4fc

Thanks.
Comment 4 Quality Engineering 2016-11-30 02:54:19 UTC
Integrated into 'main-silver', will be available in build *201611300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/dc79aaf6d4fc
User: Junichi Yamamoto <junichi11@netbeans.org>
Log: #268710 - Excessive empty lines added between docblock comments and function declaration when there is preceding inline comment