vscode icon indicating copy to clipboard operation
vscode copied to clipboard

[PHP] Running format code with leading indented php tag deletes php

Open vsccarl opened this issue 10 years ago • 3 comments

OS: Windows 10 Build#: 0.10.12-alpha Node: 4.1.1

If you have an opening <?php tag indented (with either tab or spaces) at the beginning of a php file and right click -> Format Code, it deletes all the php code included until the closing ?> tag. Additionally, if there are no html tags later on in the file, Format Code seems to do nothing.

Steps:

  1. Open a new PHP file.
  2. Add a tabbed <?php ?>
  3. Add any html tags <html> <body></body> </html>
  4. Right click -> Format Code or Alt+Shift+F
  5. Removes leading php tags and any included code.

Expected: Formats PHP code and does not delete it.

vsccarl avatar Mar 11 '16 19:03 vsccarl

@vsccarl Format is not implemented for .php files. Did you install an extension? Or is this in a .html file?

aeschli avatar Mar 14 '16 09:03 aeschli

@aeschli Ah yes, it is most likely an issue with the PHP Code Format extension. I'll open it there.

vsccarl avatar Mar 15 '16 21:03 vsccarl

Moved to https://github.com/kasik96/VSCode-PHP-Format/issues/27

vsccarl avatar Mar 15 '16 21:03 vsccarl