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;