| 106 | } |
| 107 | |
| 108 | function 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 | |
| 120 | function matchPatterns(line: string, patterns: RegExp[], kindMap: SymbolKind[]): CodeSymbol | null { |
| 121 | for (let i = 0; i < patterns.length; i++) { |