MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / getCoveredRanges

Method getCoveredRanges

src/extraction/astro-extractor.ts:221–236  ·  view source on GitHub ↗

* Line ranges (0-indexed, inclusive) the template scans must skip: * the frontmatter block and / blocks.

(
    frontmatter: { startLine: number; endLine: number } | null
  )

Source from the content-addressed store, hash-verified

219 * the frontmatter block and <script>/<style> blocks.
220 */
221 private getCoveredRanges(
222 frontmatter: { startLine: number; endLine: number } | null
223 ): Array<[number, number]> {
224 const coveredRanges: Array<[number, number]> = [];
225
226 if (frontmatter) {
227 // Cover from the opening fence line through the closing fence line
228 coveredRanges.push([frontmatter.startLine - 1, frontmatter.endLine]);
229 }
230
231 // A self-closing tag covers nothing: its attributes
232 // (`set:html={serializeJsonLd(schema)}`) are template expressions.
233 coveredRanges.push(...sfcBlockLineRanges(this.source));
234
235 return coveredRanges;
236 }
237
238 /**
239 * Extract function calls from Astro template expressions.

Callers 1

extractMethod · 0.95

Calls 2

sfcBlockLineRangesFunction · 0.90
pushMethod · 0.80

Tested by

no test coverage detected