( absPath: string, language: Language, lines: readonly number[] )
| 2192 | const MAX_DECORATOR_TEXT = 80; |
| 2193 | |
| 2194 | export async function decoratorsForFile( |
| 2195 | absPath: string, |
| 2196 | language: Language, |
| 2197 | lines: readonly number[] |
| 2198 | ): Promise<Map<number, DefinitionDecorators>> { |
| 2199 | const out = new Map<number, DefinitionDecorators>(); |
| 2200 | if (!supportsBranchGuards(language) || lines.length === 0) return out; |
| 2201 | const cached = await treeFor(absPath, language); |
| 2202 | if (!cached) return out; |
| 2203 | for (const line of lines) { |
| 2204 | if (out.has(line)) continue; |
| 2205 | const found = decoratorsInTree(cached.tree.rootNode, cached.source, line); |
| 2206 | if (found !== null) out.set(line, found); |
| 2207 | } |
| 2208 | return out; |
| 2209 | } |
| 2210 | |
| 2211 | /** {@link decoratorsForFile} over source text — the test surface. */ |
| 2212 | export async function decoratorsInSource(source: string, language: Language, line: number): Promise<DefinitionDecorators | null> { |
no test coverage detected