class
NoirAIContext::SourceReader
- NoirAIContext::SourceReader
- Reference
- Object
Overview
Reads source files once (cached per path) and extracts the
contextual snippets the augmentor attaches to AIContext entries:
a fixed-radius window around a line, or a heuristic "route scope"
that walks a handler block to its end across brace / Python-indent
/ Ruby-end styles.
Defined in:
ai_context/source_reader.crConstant Summary
-
MAX_LEAD_DECORATOR_LINES =
4 -
Maximum number of decorator / annotation lines to capture before path_info.line. Lets negative-protection markers (
@csrf_exempt,@PreAuthorize,@CrossOrigin) reach the source-scan even when the analyzer sets path_line to the functiondefrather than the decorator above it. -
MAX_ROUTE_SCOPE_LINES =
12 -
MAX_SNIPPET_CHARS =
240
Constructors
Instance Method Summary
- #lines_for(path : String | Nil) : Array(String)
- #route_scope_snippet_for(path : String | Nil, line : Int32 | Nil) : String | Nil
- #snippet_for(path : String | Nil, line : Int32 | Nil, radius : Int32) : String | Nil