Fix step-usage CodeLens anchor: connector method-name backfill never matched real wire data - #497
Merged
Merged
Conversation
2 tasks
…matched real wire data ConnectorDiscoveryService.BuildRegistry backfills the AST-precise method-identifier location for connector-discovered bindings (issue #484), replacing the connector's raw PDB sequence-point location (which lands inside the method body, not on the declaration line -- the "renders below the method" symptom). That backfill compared sd.Method against Roslyn's bare MethodDeclarationSyntax.Identifier.Text, but DiscoveryResultTransformer.GetMethodReference (connector side) actually emits "{DeclaringTypeName}.{MethodName}({ParamTypeNames})", e.g. "Steps.SetFirstNumber(Int32)" -- never a bare name. The comparison could never match on real data, so every connector-discovered binding silently fell back to the imprecise PDB line. #484's own regression test passed only because its fixture used an artificially bare Method value that doesn't occur in production, masking the bug (the PR's "Live verification in VS Code" checklist item was also left unchecked). - Add BindingImporter.ExtractBareMethodName to strip the wire-format reference down to the bare identifier before the name comparison, with pass-through for an already-bare name so existing callers/fixtures are unaffected. - Add logging (verbose/warning) at each point the backfill can fail, so a stuck lens can be diagnosed from the server log going forward. - Rewrite the demonstrating regression test to assert the fix instead of the bug; add direct unit tests for ExtractBareMethodName. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
clrudolphi
force-pushed
the
diag/connector-backfill-logging
branch
from
August 27, 2026 01:57
7ebdfc4 to
f544d82
Compare
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?
ConnectorDiscoveryService.BuildRegistrybackfills the AST-precise method-identifier location for connector-discovered bindings (issue #484), meant to replace the connector's raw PDB sequence-point location — which lands on the first executable statement inside the method body, not the declaration line (the "N step usages" lens rendering below the method instead of above it).That backfill compared
sd.Methodagainst Roslyn's bareMethodDeclarationSyntax.Identifier.Text, butDiscoveryResultTransformer.GetMethodReference(connector side) actually emits"{DeclaringTypeName}.{MethodName}({ParamTypeNames})"— e.g."Steps.SetFirstNumber(Int32)"— never a bare name. The comparison could never match on real data, so every connector-discovered binding silently fell back to the imprecise PDB line. #484's own regression test passed only because its fixture used an artificially bareMethodvalue that doesn't occur in production — masking the bug (that PR's "Live verification in VS Code" checklist item was also left unchecked).BindingImporter.ExtractBareMethodNameto strip the wire-format reference down to the bare identifier before the name comparison, with pass-through for an already-bare name so existing callers/fixtures are unaffected.ExtractBareMethodName.⚡️ What's your motivation?
Investigating a live report that the step-usage CodeLens was still rendering below the binding method declaration led back to issue #484, which was believed fixed but never actually verified live. Digging into the fix revealed it was checking a name shape that real connector output never produces.
🏷️ What kind of change is this?
🧩 Area(s) touched
src/LSP)♻️ Anything particular you want feedback on?
The new tests prove the fix with realistic wire data, but I haven't done a live VS Code verification against a real built solution — worth doing before merge given #484's history of an untested fix shipping.
📋 Checklist:
🤖 Generated with Claude Code