@@ -1181,12 +1181,7 @@ namespace FourSlash {
1181
1181
} ) ) ;
1182
1182
1183
1183
for ( const start of toArray < string | Range > ( starts ) ) {
1184
- if ( typeof start === "string" ) {
1185
- this . goToMarker ( start ) ;
1186
- }
1187
- else {
1188
- this . goToRangeStart ( start ) ;
1189
- }
1184
+ this . goToMarkerOrRange ( start ) ;
1190
1185
const fullActual = ts . map < ts . ReferencedSymbol , ReferenceGroupJson > ( this . findReferencesAtCaret ( ) , ( { definition, references } , i ) => {
1191
1186
const text = definition . displayParts . map ( d => d . text ) . join ( "" ) ;
1192
1187
return {
@@ -1203,15 +1198,7 @@ namespace FourSlash {
1203
1198
}
1204
1199
1205
1200
public verifyNoReferences ( markerNameOrRange ?: string | Range ) {
1206
- if ( markerNameOrRange ) {
1207
- if ( ts . isString ( markerNameOrRange ) ) {
1208
- this . goToMarker ( markerNameOrRange ) ;
1209
- }
1210
- else {
1211
- this . goToRangeStart ( markerNameOrRange ) ;
1212
- }
1213
- }
1214
-
1201
+ if ( markerNameOrRange ) this . goToMarkerOrRange ( markerNameOrRange ) ;
1215
1202
const refs = this . getReferencesAtCaret ( ) ;
1216
1203
if ( refs && refs . length ) {
1217
1204
this . raiseError ( `Expected getReferences to fail, but saw references: ${ stringify ( refs ) } ` ) ;
@@ -2053,6 +2040,14 @@ Actual: ${stringify(fullActual)}`);
2053
2040
this . goToPosition ( len ) ;
2054
2041
}
2055
2042
2043
+ private goToMarkerOrRange ( markerOrRange : string | Range ) {
2044
+ if ( typeof markerOrRange === "string" ) {
2045
+ this . goToMarker ( markerOrRange ) ;
2046
+ } else {
2047
+ this . goToRangeStart ( markerOrRange ) ;
2048
+ }
2049
+ }
2050
+
2056
2051
public goToRangeStart ( { fileName, pos } : Range ) {
2057
2052
this . openFile ( fileName ) ;
2058
2053
this . goToPosition ( pos ) ;
0 commit comments