felixfbecker / vscode-php-intellisense

Advanced PHP IntelliSense for Visual Studio Code 🆚💬
MIT License
410 stars 87 forks source link

VS Code - When i format with php intellisense it removes the closing `?>` php tag. #545

Open khanakia opened 3 years ago

khanakia commented 3 years ago

When i format with php intellisense it removes the closing ?> php tag.

ORIGINAL

<?php
  namespace Kwp\Comp\Raw\PortfolioSingle;
  use \Timber\Timber;
  class PortfolioSingle {
  }
?>

FORMATTED

<?php
  namespace Kwp\Comp\Raw\PortfolioSingle;
  use \Timber\Timber;
  class PortfolioSingle {
  }

How do i prevent ?> closing tag to NOT removed ?

Geekimo commented 3 years ago

Hello, the closing PHP tag is not needed anymore is file is only containing php. This is why phpintellisense removes it. See psr-2 §2.2.

khanakia commented 3 years ago

Yes i know. But i do not want it to reomoved

Geekimo commented 3 years ago

The format option uses psr's as reference. There's no other way.