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

Comment in function parameters causes all attributes to be deleted #2101

Open
Epskampie opened this issue Nov 3, 2022 · 1 comment
Open
Labels

Comments

@Epskampie
Copy link
Contributor

@prettier/plugin-php v0.19.2
Playground link

Input:

<?php

#[ATTRIBUTE]
function aaa(
  int $bbb,
  // this comment causes attribute to dissappear
  int $ccc,
) {
  var_dump('test');
}

Output:

<?php

function aaa(
    int $bbb,
    // this comment causes attribute to dissappear
    int $ccc,
) {
    var_dump("test");
}
@cseufert cseufert added the bug label Nov 7, 2022
@cseufert
Copy link
Collaborator

cseufert commented Nov 7, 2022

It looks to be a regression on v0.19.2, however, I am not that familiar with the way comments are parsed/handled.

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

No branches or pull requests

2 participants