plugin-php icon indicating copy to clipboard operation
plugin-php copied to clipboard

Comment in function parameters causes all attributes to be deleted

Open Epskampie opened this issue 3 years ago • 1 comments

@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");
}

Epskampie avatar Nov 03 '22 13:11 Epskampie

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

cseufert avatar Nov 07 '22 03:11 cseufert