Fix smart select on last blank line of file (#32544)

* Fix SmartSelection on last blank line of file

* Add baseline
This commit is contained in:
Andrew Branch 2019-07-25 09:47:57 -07:00 committed by GitHub
parent e8966ce033
commit aa12ec440c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 0 deletions

View File

@ -64,6 +64,13 @@ namespace ts.SmartSelectionRange {
parentNode = node;
break;
}
// If we made it to the end of the for loop, were done.
// In practice, Ive only seen this happen at the very end
// of a SourceFile.
if (i === children.length - 1) {
break outer;
}
}
}

View File

@ -0,0 +1,5 @@
class C {}
/**/
class C {}↲

View File

@ -0,0 +1,5 @@
/// <reference path="fourslash.ts" />
////class C {}
/////**/
verify.baselineSmartSelection();