@@ -1177,7 +1177,9 @@ Actual: ${stringify(fullActual)}`);
1177
1177
public verifyRenameLocations ( startRanges : ArrayOrSingle < Range > , options : FourSlashInterface . RenameLocationsOptions ) {
1178
1178
const { findInStrings = false , findInComments = false , ranges = this . getRanges ( ) , providePrefixAndSuffixTextForRename = true } = ts . isArray ( options ) ? { findInStrings : false , findInComments : false , ranges : options , providePrefixAndSuffixTextForRename : true } : options ;
1179
1179
1180
- for ( const startRange of toArray ( startRanges ) ) {
1180
+ const _startRanges = toArray ( startRanges ) ;
1181
+ assert ( _startRanges . length ) ;
1182
+ for ( const startRange of _startRanges ) {
1181
1183
this . goToRangeStart ( startRange ) ;
1182
1184
1183
1185
const renameInfo = this . languageService . getRenameInfo ( this . activeFile . fileName , this . currentCaretPosition ) ;
@@ -2731,6 +2733,7 @@ Actual: ${stringify(fullActual)}`);
2731
2733
2732
2734
public verifyRangesAreOccurrences ( isWriteAccess ?: boolean , ranges ?: Range [ ] ) {
2733
2735
ranges = ranges || this . getRanges ( ) ;
2736
+ assert ( ranges . length ) ;
2734
2737
for ( const r of ranges ) {
2735
2738
this . goToRangeStart ( r ) ;
2736
2739
this . verifyOccurrencesAtPositionListCount ( ranges . length ) ;
@@ -2761,6 +2764,7 @@ Actual: ${stringify(fullActual)}`);
2761
2764
2762
2765
public verifyRangesAreDocumentHighlights ( ranges : Range [ ] | undefined , options : FourSlashInterface . VerifyDocumentHighlightsOptions | undefined ) {
2763
2766
ranges = ranges || this . getRanges ( ) ;
2767
+ assert ( ranges . length ) ;
2764
2768
const fileNames = options && options . filesToSearch || unique ( ranges , range => range . fileName ) ;
2765
2769
for ( const range of ranges ) {
2766
2770
this . goToRangeStart ( range ) ;
@@ -2930,7 +2934,9 @@ Actual: ${stringify(fullActual)}`);
2930
2934
}
2931
2935
2932
2936
public noMoveToNewFile ( ) {
2933
- for ( const range of this . getRanges ( ) ) {
2937
+ const ranges = this . getRanges ( ) ;
2938
+ assert ( ranges . length ) ;
2939
+ for ( const range of ranges ) {
2934
2940
for ( const refactor of this . getApplicableRefactors ( range , { allowTextChangesInNewFiles : true } ) ) {
2935
2941
if ( refactor . name === "Move to a new file" ) {
2936
2942
ts . Debug . fail ( "Did not expect to get 'move to a new file' refactor" ) ;
0 commit comments