VSCodeBeautify icon indicating copy to clipboard operation
VSCodeBeautify copied to clipboard

Prevent formatting of a section

Open marcusdiy opened this issue 4 years ago • 1 comments

Hi, is there a way to prevent the formatting of a part of code? Something like Related to https://github.com/microsoft/TypeScript/issues/18261


$youcanformathere = 'as usal';

// @formatter:off
$keep_this_at_it_is = array(
   'a'         => 'firstvalue',
   'b'        => 'secondavalue' 
);
// @formatter:on

$youcanformatheretoo= 'as usal';

marcusdiy avatar Dec 16 '20 00:12 marcusdiy

This would be really helpful to me as well, in php -> js injections we use on the site: <script> var user = <?= json_encode($user) ?>; </script>

Code above at the moment is broken with beautify: <script> var user = < ? = json_encode($user) ? > ; //doesn't work </script>

msawired avatar Feb 28 '21 17:02 msawired