Skip to content

Commit 8971bc7

Browse files
committed
fix for VariableDeclarationList
1 parent 96d11e6 commit 8971bc7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/services/formatting/smartIndenter.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,10 @@ namespace ts.formatting {
360360
}
361361

362362
function getActualIndentationForListItem(node: Node, sourceFile: SourceFile, options: EditorSettings, listIndentsChild: boolean): number {
363+
if (node.parent && node.parent.kind === SyntaxKind.VariableDeclarationList) {
364+
// VariableDeclarationList has no wrapping tokens
365+
return Value.Unknown;
366+
}
363367
const containingList = getContainingList(node, sourceFile);
364368
const result = containingList ? getActualIndentationFromList(containingList) : Value.Unknown;
365369
if (containingList && result === Value.Unknown) {

0 commit comments

Comments
 (0)