Problem
The VB.NET extractor locates a callable's end with the first matching End Sub or End Function. A valid multiline lambda can use the same terminator inside its enclosing method, causing the outer method extent to end too early.
Discovered while reviewing #805 at head 8baf151.
Relevant code: https://github.com/conradcoffman/gortex/blob/8baf151/internal/parser/languages/vbnet.go#L256-L280
Reproduction
Public Class Worker
Public Sub Run()
Dim action = Sub()
Work()
End Sub
client.Save()
End Sub
End Class
The extracted Run node ends at the lambda's End Sub. Consequently, client.Save() is outside Run's function range and its CALLS edge is not emitted.
The same failure occurs with a multiline Function lambda inside a Function.
Expected behavior
The enclosing method should extend through its own terminator, and calls after a multiline lambda should remain attributed to that method.
Acceptance criteria
- Callable extent detection accounts for same-kind multiline lambdas.
- Add regression coverage for a
Sub lambda inside a Sub.
- Add regression coverage for a
Function lambda inside a Function.
- Assert that a qualified call after each lambda produces a
CALLS edge from the enclosing method.
- Preserve single-line extents for interface members,
MustOverride members, and auto-properties.
Problem
The VB.NET extractor locates a callable's end with the first matching
End SuborEnd Function. A valid multiline lambda can use the same terminator inside its enclosing method, causing the outer method extent to end too early.Discovered while reviewing #805 at head
8baf151.Relevant code: https://github.com/conradcoffman/gortex/blob/8baf151/internal/parser/languages/vbnet.go#L256-L280
Reproduction
The extracted
Runnode ends at the lambda'sEnd Sub. Consequently,client.Save()is outsideRun's function range and itsCALLSedge is not emitted.The same failure occurs with a multiline
Functionlambda inside aFunction.Expected behavior
The enclosing method should extend through its own terminator, and calls after a multiline lambda should remain attributed to that method.
Acceptance criteria
Sublambda inside aSub.Functionlambda inside aFunction.CALLSedge from the enclosing method.MustOverridemembers, and auto-properties.