The source a Go type declaration starts with: its line, and the next two for a list that wraps.
(n: Node, ctx: ResolutionContext)
| 960 | |
| 961 | /** The source a Go type declaration starts with: its line, and the next two for a list that wraps. */ |
| 962 | function goDeclarationText(n: Node, ctx: ResolutionContext): string { |
| 963 | const lines = ctx.getFileLines?.(n.filePath) ?? ctx.readFile(n.filePath)?.split(/\r?\n/) ?? []; |
| 964 | return lines.slice(n.startLine - 1, n.startLine + 2).join('\n'); |
| 965 | } |
| 966 | |
| 967 | /** The type parameters a Go type declares: `K` and `V` of `type Cache[K comparable, V any] struct`. */ |
| 968 | function goTypeParameterNames(n: Node, ctx: ResolutionContext): string[] { |
no test coverage detected