Skip to content

Commit 19ef6b6

Browse files
committed
Fix refactoring mistake
1 parent 79b600a commit 19ef6b6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/services/formatting/formatting.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ namespace ts.formatting {
445445
undefined;
446446

447447
if (tokenInfo) {
448-
const parent = findPrecedingToken(tokenInfo.end, sourceFile, enclosingNode) || previousParent!;
448+
const parent = findPrecedingToken(tokenInfo.end, sourceFile, enclosingNode)?.parent || previousParent!;
449449
processPair(
450450
tokenInfo,
451451
sourceFile.getLineAndCharacterOfPosition(tokenInfo.pos).line,

tests/cases/fourslash/server/formatOnTypeOpenCurlyWithBraceCompletion.ts renamed to tests/cases/fourslash/formatOnTypeOpenCurlyWithBraceCompletion.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// <reference path="../fourslash.ts"/>
1+
/// <reference path="fourslash.ts"/>
22

33
//// if (foo) {
44
//// if (bar) {/**/}

0 commit comments

Comments
 (0)