We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f579f33 commit e26bc8aCopy full SHA for e26bc8a
src/services/formatting/formatting.ts
@@ -691,6 +691,10 @@ namespace ts.formatting {
691
isListItem: boolean,
692
isFirstListItem?: boolean): number {
693
694
+ if (nodeIsMissing(child)) {
695
+ return inheritedIndentation;
696
+ }
697
+
698
const childStartPos = child.getStart(sourceFile);
699
700
const childStartLine = sourceFile.getLineAndCharacterOfPosition(childStartPos).line;
tests/cases/fourslash/formatV8Directive.ts
@@ -0,0 +1,7 @@
1
+/// <reference path="fourslash.ts" />
2
+// @Filename: foo.js
3
+//// function foo() {}
4
+//// /*1*/%PrepareFunctionForOptimization(foo)/*2*/;
5
6
+// Don't really care what it does beyond not crashing
7
+format.selection("1", "2");
0 commit comments