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