MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / goDeclarationText

Function goDeclarationText

src/resolution/callback-synthesizer.ts:962–965  ·  view source on GitHub ↗

The source a Go type declaration starts with: its line, and the next two for a list that wraps.

(n: Node, ctx: ResolutionContext)

Source from the content-addressed store, hash-verified

960
961/** The source a Go type declaration starts with: its line, and the next two for a list that wraps. */
962function 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`. */
968function goTypeParameterNames(n: Node, ctx: ResolutionContext): string[] {

Callers 2

goTypeParameterNamesFunction · 0.85
isGoTrueAliasFunction · 0.85

Calls 3

getFileLinesMethod · 0.80
readFileMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected