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 authored and GitHub committed 2019-07-25 09:47:57 -07:00
1 parent e8966ce033
commit aa12ec440c
3 files changed
+17

No files matched your search

+7
View File
@@ -64,6 +64,13 @@ namespace ts.SmartSelectionRange {
parentNode = node;
break;
}
// If we made it to the end of the for loop, we’re done.
// In practice, I’ve only seen this happen at the very end
// of a SourceFile.
if (i === children.length - 1) {
break outer;
}
}
}
@@ -0,0 +1,5 @@
class C {}
/**/
class C {}↲
@@ -0,0 +1,5 @@
/// <reference path="fourslash.ts" />
////class C {}
/////**/
verify.baselineSmartSelection();