Cool, thanks!
It seems to work in most cases after hitting ;
But there might be some irritation:
function t():void{echo 1;}
results in
function t(): void
{
echo 1;}
Enter after ; results in
function t(): void
/*tab*/ {
/*tab*/ echo 1;
} // no tab !
function d(
autocompletes to
function d()
with cursor between () // good
[end]{
autocompletes to
function d(){}
with cursor between {} // good
When adding
echo 1;
nothing happens.
Only after removing } and adding new } the desired result is
function d()
{
echo 2;
}
settings.json:
// Legacy:
"typescript.format.placeOpenBraceOnNewLineForFunctions": true,
"typescript.format.placeOpenBraceOnNewLineForControlBlocks": true,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false,
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false,
"editor.detectIndentation": false,
// php.format:
"php.format.codeStyle": "Allman",
"php.format.rules.indentBraces": true,
Format document (Ctrl Shift I) does nothing at
function p(): bool
{
return true;} //last line
Only if there is following line the } will be on desired position.