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

Function goDeclarationText

src/resolution/callback-synthesizer.ts:1026–1029  ·  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

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

Callers 2

goTypeParameterNamesFunction · 0.85
isGoTrueAliasFunction · 0.85

Calls 3

getFileLinesMethod · 0.80
readFileMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected