Skip to content

Pass cursor to wrapped visitors in UpgradeTransitiveDependencyVersion - #201

Merged
timtebeek merged 1 commit into
mainfrom
tim/upgradetransitivedependencyversion-cursor-fix
Oct 1, 2026
Merged

timtebeek merged 1 commit into
mainfrom
tim/upgradetransitivedependencyversion-cursor-fix

Conversation

@timtebeek

Copy link
Copy Markdown
Member

The delegating visitor in UpgradeTransitiveDependencyVersion now calls visitNonNull(t, ctx, getCursor()) on the Gradle and Maven visitors it wraps, so they run under the recipe cycle's root cursor instead of a fresh root per file. openrewrite/rewrite is moving rewrite-gradle's parsed-snippet cache from the ExecutionContext onto cursor.getRoot(); without this, that cache would only last a single file and every file would reparse the Gradle snippets. No behavior change, only avoids repeated (slow) GradleParser work.

Lets the Gradle visitor reach the cycle's root cursor, so caches stored
on cursor.getRoot() are shared across files instead of reset per file.
@timtebeek
timtebeek merged commit 6604070 into main Oct 1, 2026
1 check passed
@timtebeek
timtebeek deleted the tim/upgradetransitivedependencyversion-cursor-fix branch October 1, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant