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

Method getCoveredRanges

src/extraction/astro-extractor.ts:224–239  ·  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

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

Callers 1

extractMethod · 0.95

Calls 3

elementsMethod · 0.95
sfcElementLineRangesFunction · 0.90
pushMethod · 0.80

Tested by

no test coverage detected