Resolve Run CodeLens test targets per-target instead of whole-file (#495) - #496
Merged
Merged
Conversation
…hole file (#495) RunTestCodeLensService/VS Code's runCodeLens.ts/Rider's RunLensSupport all resolved reqnroll/resolveTestTargets for every scenario in a .feature file on every call, so a 2,000+-scenario stress corpus took 30-45s per walk, exceeding VS's own CodeLens timeout. - VS: split GetTargetsForLineAsync (one line, per data point) from GetTagLocationsAsync (symbol tree only, no resolution, feeds the tagger); result cache re-keyed by (file, line). - VS Code: switched runCodeLens.ts to the standard provideCodeLenses/resolveCodeLens two-phase contract, so resolution only happens for visible lenses. - Rider: added RunTestTargetCache, an identity-keyed per-scenario cache, since CodeVisionProvider has no per-line/visible-range hook the way the other two do; invalidated via the same reqnroll/refreshCodeLenses signal Hook/StepUsages already use (which also fixes Run never being wired into that refresh at all). - Added reqnroll/resolveTestTargets to the performance benchmark: an isolated latency scenario plus a concurrent-callers contention scenario against a synthetic ~2,000-scenario file, mirroring WorkspaceReloadContentionScenario's shape. - Updated Test-Runner-Integration-Design.md / LSP-IDE-Support-Feature-Designs.md to reflect the per-client split and Rider's as-built CodeVisionProvider implementation. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CI's format:check flagged both files — line-wrap only, no logic change. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤔 What's changed?
RunTestCodeLensService/VS Code'srunCodeLens.ts/Rider'sRunLensSupportall resolvedreqnroll/resolveTestTargetsfor every scenario in a.featurefile on every refresh, instead of just the scenario(s) actually needed. Split per client, since each platform's extensibility contract determines what's actually possible:RunTestCodeLensService.GetTargetsAsync(whole file) split intoGetTargetsForLineAsync(fileUri, line)(one resolution, called by each line's ownRunTestCodeLensDataPoint) andGetTagLocationsAsync(fileUri)(symbol tree only, zeroresolveTestTargetscalls, feeds the tagger). Result cache re-keyed by(fileUri, line).runCodeLens.tsnow implements the standard two-phaseprovideCodeLenses/resolveCodeLenscontract:provideCodeLensesplaces unresolved lenses from the symbol tree only,resolveCodeLensresolves lazily, only for lenses that scroll into view.RunTestTargetCache, an identity-keyed per-scenario cache, sinceCodeVisionProviderhas no visible-range/resolve-lazily hook the way the other two platforms do. Invalidated via the samereqnroll/refreshCodeLensessignal Hook/StepUsages CodeVision providers already act on — which also fixed a pre-existing gap where the Run lens was never wired to that refresh at all.reqnroll/resolveTestTargetsto the performance benchmark: an isolated latency scenario, plus a concurrent-callers contention scenario against a synthetic ~2,000-scenario file, followingWorkspaceReloadContentionScenario's shape.Test-Runner-Integration-Design.mdandLSP-IDE-Support-Feature-Designs.mdwith the per-client breakdown and Rider's as-builtCodeVisionProviderimplementation (the doc still described the originally-proposedRunLineMarkerContributor).⚡️ What's your motivation?
Fixes #495. On the
VeryLargeFeaturestress corpus (~2,000-2,400 scenarios in one file), the whole-file walk took 30-45s per refresh — independently slow enough to exceed VS's own classic-CodeLens per-data-point timeout (~26s), even after #492's syntax-tree caching made each individual resolution cheap. #492-#494 made the walk's own per-call cost cheap and de-duplicated concurrent callers, but nothing before this reduced the number of calls a walk actually issues.🏷️ What kind of change is this?
🧩 Area(s) touched
src/LSP) — benchmark tooling only, no handler changessrc/VisualStudio)src/VSCode)src/Rider)♻️ Anything particular you want feedback on?
Rider's
RunTestTargetCacheceiling ratio (200x) for the new contention benchmark is a placeholder based on one local run (~140x observed) — no reference-machine calibration data exists yet for this specific operation shape (concurrent requests-with-response, unlike the siblingdidChange-storm scenario's fire-and-forget notifications).📋 Checklist:
docs/🤖 Generated with Claude Code