(source: string, language: Language, line: number)
| 2210 | |
| 2211 | /** {@link decoratorsForFile} over source text — the test surface. */ |
| 2212 | export async function decoratorsInSource(source: string, language: Language, line: number): Promise<DefinitionDecorators | null> { |
| 2213 | if (!supportsBranchGuards(language)) return null; |
| 2214 | const tree = await parse(source, language); |
| 2215 | if (!tree) return null; |
| 2216 | try { |
| 2217 | return decoratorsInTree(tree.rootNode, source, line); |
| 2218 | } finally { |
| 2219 | tree.delete(); |
| 2220 | } |
| 2221 | } |
| 2222 | |
| 2223 | export function decoratorsInTree(root: SyntaxNode, source: string, line: number): DefinitionDecorators | null { |
| 2224 | const row = line - 1; |
no test coverage detected