Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong indentation after use statements #6980

Closed
junichi11 opened this issue Jan 21, 2024 · 0 comments · Fixed by #6981
Closed

Wrong indentation after use statements #6980

junichi11 opened this issue Jan 21, 2024 · 0 comments · Fixed by #6981
Assignees
Labels
kind:bug Bug report or fix PHP [ci] enable extra PHP tests (php/php.editor)
Milestone

Comments

@junichi11
Copy link
Member

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

@junichi11 junichi11 added kind:bug Bug report or fix PHP [ci] enable extra PHP tests (php/php.editor) labels Jan 21, 2024
@junichi11 junichi11 added this to the NB22 milestone Jan 21, 2024
@junichi11 junichi11 self-assigned this Jan 21, 2024
junichi11 added a commit to junichi11/netbeans that referenced this issue Jan 21, 2024
- apache#6980
- Fix the below case
- Add unit tests

Example:

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

Before:

```php
<?php

namespace {

    use Vendor\Class1;

$test = 1;
}
```

After:

```php
<?php

namespace {

    use Vendor\Class1;

    $test = 1;
}
```
@junichi11 junichi11 linked a pull request Jan 21, 2024 that will close this issue
junichi11 added a commit that referenced this issue Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Bug report or fix PHP [ci] enable extra PHP tests (php/php.editor)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant