@@ -271,24 +271,18 @@ func (r *rootResolver) UsagesForSymbol(ctx context.Context, unresolvedArgs *reso
271
271
remainingCount := int (args .RemainingCount )
272
272
provsForSCIPData := args .Symbol .ProvenancesForSCIPData ()
273
273
usageResolvers := []resolverstubs.UsageResolver {}
274
- cursor := args .Cursor
275
274
276
- if cursor .IsPrecise () && ! provsForSCIPData .Precise {
277
- cursor = codenav.UsagesCursor {CursorType : codenav .CursorTypeSyntactic }
278
- }
279
- if provsForSCIPData .Precise && cursor .IsPrecise () {
275
+ cursor := args .Cursor
276
+ if cursor .IsPrecise () {
280
277
nextPreciseCursor , preciseUsageResolvers := r .preciseUsages (ctx , trace , args , remainingCount )
281
278
usageResolvers = append (usageResolvers , preciseUsageResolvers ... )
282
279
numPreciseResults = len (preciseUsageResolvers )
283
280
remainingCount -= min (remainingCount , numPreciseResults )
284
- cursor = nextPreciseCursor . UnwrapOr (codenav. UsagesCursor { CursorType : codenav . CursorTypeSyntactic } )
281
+ cursor = cursor . AdvanceCursor ( nextPreciseCursor , provsForSCIPData )
285
282
}
286
283
287
- if cursor .IsSyntactic () && ! provsForSCIPData .Syntactic {
288
- cursor = codenav.UsagesCursor {CursorType : codenav .CursorTypeSearchBased }
289
- }
290
284
previousSyntacticSearch := core .None [codenav.PreviousSyntacticSearch ]()
291
- if provsForSCIPData . Syntactic && cursor .IsSyntactic () && remainingCount > 0 {
285
+ if cursor .IsSyntactic () && remainingCount > 0 {
292
286
usagesForSymbolArgs := codenav.UsagesForSymbolArgs {
293
287
Repo : args .Repo ,
294
288
Commit : args .CommitID ,
@@ -300,13 +294,10 @@ func (r *rootResolver) UsagesForSymbol(ctx context.Context, unresolvedArgs *reso
300
294
usageResolvers = append (usageResolvers , syntacticUsageResolvers ... )
301
295
numSyntacticResults = len (syntacticUsageResolvers )
302
296
remainingCount -= min (remainingCount , numSyntacticResults )
303
- cursor = nextSyntacticCursor . UnwrapOr (codenav. UsagesCursor { CursorType : codenav . CursorTypeSearchBased } )
297
+ cursor = cursor . AdvanceCursor ( nextSyntacticCursor , provsForSCIPData )
304
298
}
305
299
306
- if cursor .IsSearchBased () && ! provsForSCIPData .SearchBased {
307
- cursor = codenav.UsagesCursor {CursorType : codenav .CursorTypeDone }
308
- }
309
- if provsForSCIPData .SearchBased && cursor .IsSearchBased () && remainingCount > 0 {
300
+ if cursor .IsSearchBased () && remainingCount > 0 {
310
301
usagesForSymbolArgs := codenav.UsagesForSymbolArgs {
311
302
Repo : args .Repo ,
312
303
Commit : args .CommitID ,
@@ -318,7 +309,7 @@ func (r *rootResolver) UsagesForSymbol(ctx context.Context, unresolvedArgs *reso
318
309
)
319
310
usageResolvers = append (usageResolvers , searchBasedUsageResolvers ... )
320
311
numSearchBasedResults = len (searchBasedUsageResolvers )
321
- cursor = nextSearchBasedCursor . UnwrapOr (codenav. UsagesCursor { CursorType : codenav . CursorTypeDone } )
312
+ cursor = cursor . AdvanceCursor ( nextSearchBasedCursor , provsForSCIPData )
322
313
}
323
314
324
315
pageInfo := resolverstubs .NewSimplePageInfo (false )
0 commit comments