MCPcopy Index your code
hub / github.com/forloopcodes/contextplus / extractHeader

Function extractHeader

src/core/parser.ts:108–118  ·  view source on GitHub ↗
(lines: string[])

Source from the content-addressed store, hash-verified

106}
107
108function extractHeader(lines: string[]): string {
109 const headerLines: string[] = [];
110 for (const line of lines.slice(0, 10)) {
111 const stripped = line.replace(/^\/\/\s?|^#\s?|^--\s?|^\*\s?|^\/\*\*?\s?|\*\/$/g, "").trim();
112 if (stripped && !stripped.startsWith("!") && !stripped.startsWith("use ") && !stripped.startsWith("import ")) {
113 headerLines.push(stripped);
114 if (headerLines.length >= 2) break;
115 }
116 }
117 return headerLines.join(" | ");
118}
119
120function matchPatterns(line: string, patterns: RegExp[], kindMap: SymbolKind[]): CodeSymbol | null {
121 for (let i = 0; i < patterns.length; i++) {

Callers 1

analyzeFileFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected