Skip to content

Preserve innermost callable containment for C# calls, local functions, and lambdas #4840

Description

@Widthdom

Summary

C# containment repeatedly skips the enclosing callable and attaches nested evidence directly to the class: hundreds of calls inside block-bodied test methods collapse to QueryCommandRunnerTests, local functions such as TryReadSchemaValue skip ParseOptions, and lambdas declared inside methods also attach to the class.

Audit IDs: Q-07, G-04, and G-05. This is a current regression/follow-up to closed #233 and #4417; closed #194 and #1969 are adjacent containment work.

Expected behavior

At any source location, container assignment should prefer the innermost compatible callable range before a containing type.

PR scope

These three symptoms share callable containment/range selection and belong in one PR. Same-line compact-type edge cases outside these fixtures should be added only if the shared resolver fixes them without broadening scope.

Implementation guide for Codex 5.6 sol xhigh

Acceptance criteria

  • Calls are attributed to the actual test method, not the test class.
  • Local functions/lambdas identify their enclosing callable.
  • Top-level/type-level cases and valid nested types keep correct containers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .NET codebugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions