drop trailing trivia prior to rescanning it
This commit is contained in:
parent
a6d374ee21
commit
8497667f33
|
@ -187,6 +187,9 @@ module ts.formatting {
|
|||
}
|
||||
|
||||
// consume trailing trivia
|
||||
if (trailingTrivia) {
|
||||
trailingTrivia = undefined;
|
||||
}
|
||||
while(scanner.getStartPos() < endPos) {
|
||||
currentToken = scanner.scan();
|
||||
if (!isTrivia(currentToken)) {
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
/// <reference path="fourslash.ts"/>
|
||||
////var x = `sadasdasdasdasfegsfd
|
||||
/////*1*/rasdesgeryt35t35y35 e4 ergt er 35t 3535 `;
|
||||
////var y = `1${2}/*2*/3`;
|
||||
|
||||
|
||||
goTo.marker("1");
|
||||
edit.insert("\r\n"); // edit will trigger formatting - should succeeed
|
||||
|
||||
goTo.marker("2");
|
||||
edit.insert("\r\n");
|
||||
verify.indentationIs(0);
|
||||
verify.currentLineContentIs("3`;")
|
Loading…
Reference in a new issue