mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-12-13 04:57:55 -06:00
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:
parent
e8966ce033
commit
aa12ec440c
@ -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 {}↲
|
||||
5
tests/cases/fourslash/smartSelection_lastBlankLine.ts
Normal file
5
tests/cases/fourslash/smartSelection_lastBlankLine.ts
Normal file
@ -0,0 +1,5 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
////class C {}
|
||||
/////**/
|
||||
|
||||
verify.baselineSmartSelection();
|
||||
Loading…
x
Reference in New Issue
Block a user