From ad010ea8ee240054cf2beedf5e50e760eab43b21 Mon Sep 17 00:00:00 2001 From: SaschaNaz Date: Thu, 10 Sep 2015 02:31:27 +0900 Subject: [PATCH] Add some comments to isIndentationPrevented --- src/services/formatting/smartIndenter.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index 86ee0f5f363..05aa867113d 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -478,12 +478,15 @@ namespace ts.formatting { } } + /** + * Function returns true if a node should not get additional indentation in its parent node. + */ export function isIndentationPrevented(node: TextRangeWithKind) { switch (node.kind) { case SyntaxKind.NamedExports: return true; - // NamedImports has its own braces as Block does case SyntaxKind.ImportClause: + // NamedImports has its own braces as Block does return (node).namedBindings.kind === SyntaxKind.NamedImports; } return false;