Skip to content

PHP autoindent with arrays is even more stupid #248229

Open
@php4fan

Description

@php4fan

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.99.3
  • OS Version: Manjaro Linux

Steps to Reproduce:

Say I want to write an array like the following:

<?php

$array = [
    [
        "one",
        "two"
    ]
];

This is not only a very reasonable, but also very standard and common way to indent an array of arrays.

I start typing this:

<?php

$array = [

and immediately, the IDE adds the closing ], and the cursor is between the two []. So I hit enter and I get this, as expected:

Image

(the arrow highlights where the text cursor is).

So I type the next [ and hit Enter again and I get this:

Image

again as expected.

I fill in the array and move the text cursor to the end:

Image

So far so good.

Now, the moment I add the semicolon, something completely idiotic happens:

A completely nonsensical indentation is added before the ], which had been in the right place all along:

Image

This is infinitely more stupid than #248227

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugeditor-autoindentEditor auto indentation issuesphpPHP support issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions