module Noir::CSharpCalleeExtractor

Extended Modules

Defined in:

miniparsers/csharp_callee_extractor.cr

Constant Summary

BINDING_ATTRIBUTES = Set {"FromQuery", "FromRoute", "FromBody", "FromHeader", "FromForm", "FromServices", "FromKeyedServices", "AsParameters", "Description", "DefaultValue", "Required", "BindRequired", "BindNever"}

Parameter-binding / documentation attributes ([FromHeader(...)], [AsParameters], [Description(...)], …). They sit inside a lambda's parameter list, so the line scanner sees them as calls — they aren't.

CALL_REGEX = /((?:[A-Za-z_][\w]*)(?:\s*\.\s*[A-Za-z_][\w]*)*)\s*(?:<[^>\n]+>)?\s*\(/
RESERVED = Set {"as", "async", "await", "base", "case", "catch", "checked", "default", "delegate", "do", "else", "event", "explicit", "finally", "fixed", "for", "foreach", "if", "implicit", "is", "lock", "nameof", "new", "operator", "return", "sizeof", "switch", "this", "throw", "typeof", "unchecked", "unsafe", "using", "while"}
ROUTE_BUILDER_METHODS = Set {"Map", "MapGet", "MapPost", "MapPut", "MapDelete", "MapPatch", "MapHead", "MapOptions", "MapMethods", "MapGroup"}
ROUTE_METADATA_METHODS = Set {"WithName", "WithSummary", "WithDescription", "WithTags", "WithOpenApi", "WithMetadata", "WithDisplayName", "WithGroupName", "WithOrder", "Produces", "ProducesProblem", "ProducesValidationProblem", "ProducesResponseType", "Accepts", "RequireAuthorization", "AllowAnonymous", "RequireCors", "RequireHost", "RequireRateLimiting", "DisableRateLimiting", "CacheOutput", "DisableAntiforgery", "ExcludeFromDescription", "AddEndpointFilter", "AddEndpointFilterFactory", "WithRequestTimeout", "MapToApiVersion", "HasApiVersion", "HasDeprecatedApiVersion", "IsApiVersionNeutral", "ReportApiVersions", "WithApiVersionSet", "NewVersionedApi"}

Fluent route-builder metadata calls (.WithName(...), .Produces(...), [ProducesResponseType(...)], …) and API-versioning helpers configure the endpoint registration — they aren't handler behavior, so they're noise in the callee/ai-context surface. Matched on the trailing segment.

Instance Method Summary

Instance Method Detail

def attach_to(endpoint : Endpoint, callees : Array(Entry)) #

[View source]
def callees_for_block(block : String, file_path : String, start_line : Int32, *, skip_first_line : Bool = false) : Array(Entry) #

[View source]