Open ichiriac opened 7 years ago
Could also include this topic : (Format Line on Type Provider https://github.com/HvyIndustries/crane/issues/214) - the formating would be based on the same configuration for space indentation.
Couldn't it be provided as a VS Code Document Formatter instead of a custom shortcut ?
Integrate https://github.com/glayzzle/php-unparser as external library in order to format back PHP code.
This library consume php-parser AST tree and builds back the PHP formatting with proper indentation. Can try here an old online version : https://chris-l.github.io/php-unparser/.
Actually supported options :
if
,for
... and the paranthesisAs the formatting is based on AST, the simplest is to re-format all the file.
ToDo :
create a branch : as the maintainer of the original library does not merge or work on the library, fork it and publish a new npm library
refactor options : put into options any kind of parameter (brackets on same line on function/class/other) ... etc ...
create rulesets : using option pressets configure PSR1...,N/Zend/PEAR...
declare a shortcut command like CTRL+MAJ+F