mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
simplified code flow
This commit is contained in:
@@ -403,16 +403,13 @@ namespace ts.formatting {
|
||||
indentation = parentDynamicIndentation.getIndentation();
|
||||
}
|
||||
}
|
||||
else if (SmartIndenter.isIndentationPrevented(node)) {
|
||||
else if (SmartIndenter.isIndentationPrevented(node) ||
|
||||
SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) {
|
||||
|
||||
indentation = parentDynamicIndentation.getIndentation();
|
||||
}
|
||||
else {
|
||||
if (SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) {
|
||||
indentation = parentDynamicIndentation.getIndentation();
|
||||
}
|
||||
else {
|
||||
indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta();
|
||||
}
|
||||
indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -482,7 +482,7 @@ namespace ts.formatting {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.NamedExports:
|
||||
return true;
|
||||
// Allow indentation only when namedBindings is NamespaceImport.
|
||||
// NamedImports has its own braces as Block does
|
||||
case SyntaxKind.ImportClause:
|
||||
return (<ImportClause>node).namedBindings.kind === SyntaxKind.NamedImports;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user