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

Match expression comment line incorrectly indented #3062

Open
Da-nie-elT opened this issue Sep 16, 2024 · 0 comments
Open

Match expression comment line incorrectly indented #3062

Da-nie-elT opened this issue Sep 16, 2024 · 0 comments

Comments

@Da-nie-elT
Copy link

Da-nie-elT commented Sep 16, 2024

Describe the bug
Placing a comment line above the default keyword in a match() {} expression will be incorrectly indented on formatting.

To Reproduce
Before formatting:

match ($number) {
  // comment for expression 1
  1 => '1',

  // comment for expression 2
  2 => '2',

  // comment for default
  default => '0'
};

After formatting:

match ($number) {
  // comment for expression 1
  1 => '1',

  // comment for expression 2
  2 => '2',

    // comment for default
  default => '0'
};

Expected behavior
The comment above the default should stay on the same column as the others.

Platform and version
macOS Sonoma: Version 14.6.1 (23G93)
PHP: 8.0.13
PHP Intelephense: v1.12.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants