Skip to content

Wrong indentation after use statements #6980

@junichi11

Description

@junichi11

Apache NetBeans version

Apache NetBeans 20

What happened

Get incorrect result we format the below example:

Example:

<?php
namespace {
    use Vendor\Class1;
    $test = 1;
}

Result:

<?php

namespace {

    use Vendor\Class1;

$test = 1;
}

Language / Project Type / NetBeans Component

PHP editor

How to reproduce

Steps to reproduce it:

  1. Create a new file
  2. Copy & Paste the below example to the new file
  3. Source > Format

Options:

default

Example:

<?php
namespace {
    use Vendor\Class1;
    $test = 1;
}

Expected result:

<?php

namespace {

    use Vendor\Class1;

    $test = 1;
}

Actual result:

<?php

namespace {

    use Vendor\Class1;

$test = 1;
}

Did this work correctly in an earlier version?

No / Don't know

Operating System

Ubuntu 22.04

JDK

JDK 19

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

No response

Are you willing to submit a pull request?

Yes

Metadata

Metadata

Assignees

Labels

PHP[ci] enable extra PHP tests (php/php.editor)kind:bugBug report or fix

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions