Skip to content

Commit d7f1935

Browse files
committed
remove deprecated function
1 parent 7561ec0 commit d7f1935

File tree

1 file changed

+0
-51
lines changed

1 file changed

+0
-51
lines changed

src/services/formatting/smartIndenter.ts

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,6 @@ namespace ts.formatting {
128128
if (actualIndentation !== Value.Unknown) {
129129
return actualIndentation;
130130
}
131-
actualIndentation = getLineIndentationWhenExpressionIsInMultiLine(current, sourceFile, options);
132-
if (actualIndentation !== Value.Unknown) {
133-
return actualIndentation + options.indentSize!; // TODO: GH#18217
134-
}
135131

136132
previous = current;
137133
current = current.parent;
@@ -188,10 +184,6 @@ namespace ts.formatting {
188184
if (actualIndentation !== Value.Unknown) {
189185
return actualIndentation + indentationDelta;
190186
}
191-
actualIndentation = getLineIndentationWhenExpressionIsInMultiLine(current, sourceFile, options);
192-
if (actualIndentation !== Value.Unknown) {
193-
return actualIndentation + indentationDelta;
194-
}
195187
}
196188

197189
// increase indentation if parent node wants its content to be indented and parent and child nodes don't start on the same line
@@ -388,49 +380,6 @@ namespace ts.formatting {
388380
return Value.Unknown;
389381
}
390382

391-
function getLineIndentationWhenExpressionIsInMultiLine(node: Node, sourceFile: SourceFile, options: EditorSettings): number {
392-
// actual indentation should not be used when:
393-
// - node is close parenthesis - this is the end of the expression
394-
if (node.kind === SyntaxKind.CloseParenToken) {
395-
return Value.Unknown;
396-
}
397-
398-
if (node.parent && isCallOrNewExpression(node.parent) && node.parent.expression !== node) {
399-
const fullCallOrNewExpression = node.parent.expression;
400-
const startingExpression = getStartingExpression(fullCallOrNewExpression);
401-
402-
if (fullCallOrNewExpression === startingExpression) {
403-
return Value.Unknown;
404-
}
405-
406-
const fullCallOrNewExpressionEnd = sourceFile.getLineAndCharacterOfPosition(fullCallOrNewExpression.end);
407-
const startingExpressionEnd = sourceFile.getLineAndCharacterOfPosition(startingExpression.end);
408-
409-
if (fullCallOrNewExpressionEnd.line === startingExpressionEnd.line) {
410-
return Value.Unknown;
411-
}
412-
413-
return findColumnForFirstNonWhitespaceCharacterInLine(fullCallOrNewExpressionEnd, sourceFile, options);
414-
}
415-
416-
return Value.Unknown;
417-
418-
function getStartingExpression(node: Expression) {
419-
while (true) {
420-
switch (node.kind) {
421-
case SyntaxKind.CallExpression:
422-
case SyntaxKind.NewExpression:
423-
case SyntaxKind.PropertyAccessExpression:
424-
case SyntaxKind.ElementAccessExpression:
425-
node = (<PropertyAccessExpression | CallExpression | NewExpression | ElementAccessExpression | PropertyAccessExpression>node).expression;
426-
break;
427-
default:
428-
return node;
429-
}
430-
}
431-
}
432-
}
433-
434383
function deriveActualIndentationFromList(list: ReadonlyArray<Node>, index: number, sourceFile: SourceFile, options: EditorSettings): number {
435384
Debug.assert(index >= 0 && index < list.length);
436385
const node = list[index];

0 commit comments

Comments
 (0)