prettier / prettier/plugin-php
multi-line comment duplicated, leaking outside PHP blocks
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- PHP
- Sterne
- 1.9k
- Forks
- 139
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
The obvious problem is that the multi-line comment is being duplicated and jumping outside the PHP block. But it's weirder, variations are below the main report example.
@prettier/plugin-php v0.11.2
Playground link
Input:
<?php ?>
<?php ?>
<?php
/**
* comment
*/
$var = 0;
$var = 1;
?>
<?php ?>
Output:
<?php ?>
/**
* comment
*/<?php
/**
* comment
*/
?>
$var = 0;
$var = 1;
?>
Additional examples (links go to playground variations):
- Add a blank line between the first two
<?php ?>blocks: Works correctly. - Remove all blank lines between
<?php ?>blocks: Works correctly (mostly, whitespace) - Add a single character to the comment (
comments): Works correctly (mostly, whitespace) - Add two characters to the comment (
commentss): Broken
I didn't run into this with empty PHP blocks, here's the are some examples with code in the PHP blocks, behavior appears to be the same:
- Code blocks,
comment: Broken - Code blocks,
comments: Works correctly (mostly, whitespace - Code blocks, no blank lines: Works correctly (mostly, whitespace)
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die gemeldete Duplizierung von mehrzeiligen Kommentaren mit dem verknüpften Playground-Beispiel zu reproduzieren, und vergleiche anschließend die aufgeführten Variationen mit Leerzeilen, Kommentarlänge und Codeblöcken. Verfolge den für Kommentare und PHP-Blockgrenzen verantwortlichen PHP-Formatierungspfad. Als erledigt gilt die Aufgabe, wenn der Kommentar einmal ausgegeben wird und in den gemeldeten Fällen innerhalb des PHP-Blocks bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- php
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100