vscode-phpfmt icon indicating copy to clipboard operation
vscode-phpfmt copied to clipboard

How to disable triming spaces from <?= ... ?> to <?=...?> in short echo tag?

Open IkotikI opened this issue 1 year ago • 2 comments

So, on save in short echo tags <?= ... ?> spaces before and after trimmed after formatting. Example: Before: <?= $name ?> After: <?=$name?>

How to disable it? In normal tags <?php ... ?> nothing trimmed, and that's what I need.

IkotikI avatar Jul 16 '24 08:07 IkotikI

Hi @IkotikI. I'm sorry I don't think you can avoid do this, formatting the spaces this way it's in the inner part of the rules, not an special one you can active/deactivate

driade avatar Jul 16 '24 08:07 driade

Thus, to be more clear, I should create an special rule to make the formatter behave this way, something you could opt in as "KeepSpaceAfterShortOpen", that would run after "ResizeSpaces".

At this moment I'm limiting the number of new rules to be created, as they're time consuming. My goal is to fix errors in the current ones.

Thanks!

driade avatar Aug 08 '24 15:08 driade