[TwigComponent] Minimal support of comment lines - #2464
Conversation
Kocal
left a comment
There was a problem hiding this comment.
Cool!
I don't have real use-cases from the projets I'm working on, but I believe it will be super-useful (even if I believe some comments can be avoid by using good attribute's name or variable!)
However, introducing a new syntax means that tools manipulating ASTs (like IDEs, Twig-CS-Fixer, maybe TwigStan, and syntax highlighting) will break, right?
|
Not at all, they already are compatible. I'm just following Twig syntax here, not adding anything new. But that means adapting the PreLexer we use to convert HTML Syntax into regular Twig code :) |
They do, and they integrated inline comments right after Twig release :)
Me neither but... how is this related to this PR ? :) I'm genuinely not sure to get the questions here. Twig syntax changes are generally pretty quickly integrated into PhpStorm Twig integration (or in the Symfony plugin). |
94noni
left a comment
There was a problem hiding this comment.
Would be very welcome to allow props comment next to/along the usage in the template👍🏻
bab6e5b to
11d8d12
Compare
Twig introduced the inline comments in twigphp/Twig#4349 This PR add minimal support for it the PreLexer / HTML syntax ```twig <twig:Button # comment bar="bar" /> ``` I'd like some IRL feedbacks on this one :)
11d8d12 to
df97990
Compare
|
Thanks Simon. |

Twig introduced the inline comments in twigphp/Twig#4349
This PR add minimal support for it the PreLexer / HTML syntax
I'd like some IRL feedbacks on this one :)