do not insert space after function expressions

This commit is contained in:
Kagami Sascha Rosylight
2016-12-21 21:54:40 +09:00
parent a4ec7d66eb
commit ba7c1a13c3
3 changed files with 17 additions and 5 deletions

View File

@@ -705,11 +705,18 @@ namespace ts.formatting {
case SyntaxKind.ClassDeclaration:
case SyntaxKind.ModuleDeclaration:
case SyntaxKind.EnumDeclaration:
case SyntaxKind.Block:
case SyntaxKind.CatchClause:
case SyntaxKind.ModuleBlock:
case SyntaxKind.SwitchStatement:
return true;
case SyntaxKind.Block: {
const blockParent = context.currentTokenParent.parent;
if (blockParent.kind !== SyntaxKind.ArrowFunction &&
blockParent.kind !== SyntaxKind.FunctionExpression)
{
return true;
}
}
}
return false;
}