mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
apply suppression to tokens
This commit is contained in:
@@ -387,9 +387,7 @@ namespace ts.formatting {
|
||||
|
||||
let indentation = inheritedIndentation;
|
||||
if (indentation === Constants.Unknown) {
|
||||
if (SmartIndenter.shouldInheritParentIndentation(parent, node) ||
|
||||
SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) {
|
||||
|
||||
if (SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) {
|
||||
indentation = parentDynamicIndentation.getIndentation();
|
||||
}
|
||||
else {
|
||||
@@ -590,6 +588,10 @@ namespace ts.formatting {
|
||||
return inheritedIndentation;
|
||||
}
|
||||
|
||||
if (SmartIndenter.shouldInheritParentIndentation(parent, child)) {
|
||||
parentDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentation, 0);
|
||||
}
|
||||
|
||||
if (isToken(child)) {
|
||||
// if child node is a token, it does not impact indentation, proceed it using parent indentation scope rules
|
||||
let tokenInfo = formattingScanner.readTokenInfo(child);
|
||||
|
||||
Reference in New Issue
Block a user