We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a6d374e commit 8497667Copy full SHA for 8497667
2 files changed
src/services/formatting/formattingScanner.ts
@@ -187,6 +187,9 @@ module ts.formatting {
187
}
188
189
// consume trailing trivia
190
+ if (trailingTrivia) {
191
+ trailingTrivia = undefined;
192
+ }
193
while(scanner.getStartPos() < endPos) {
194
currentToken = scanner.scan();
195
if (!isTrivia(currentToken)) {
tests/cases/fourslash/formatTemplateLiteral.ts
@@ -1,7 +1,13 @@
1
/// <reference path="fourslash.ts"/>
2
////var x = `sadasdasdasdasfegsfd
3
/////*1*/rasdesgeryt35t35y35 e4 ergt er 35t 3535 `;
4
+////var y = `1${2}/*2*/3`;
5
+
6
7
goTo.marker("1");
8
edit.insert("\r\n"); // edit will trigger formatting - should succeeed
9
10
+goTo.marker("2");
11
+edit.insert("\r\n");
12
+verify.indentationIs(0);
13
+verify.currentLineContentIs("3`;")
0 commit comments