/** * Go source symbol extraction using `go/parser`. * * Runs the extraction program from `toolchain-scripts.ts` under `go run`, with * the source on stdin, and decodes its JSON. When the toolchain is missing or * the run yields nothing, a line-based extractor keeps the file indexed. * * Extracts: func, method, type, const, var */ import type { FileSymbols, SymbolLang } from './schema.js'; export declare function parseSymbols(opts: { file: string; content: string; lang: SymbolLang; }): Promise; export { detectLang } from './languages.js'; /** * Blank comment and string/rune literal contents, keeping offsets and newlines. * Quote characters survive so the line structure stays readable. */ export declare function maskGoNonCode(src: string): string; /** * Line-based extraction for when `go run` is unavailable or failed. * * Runs over {@link maskGoNonCode} output and only reads declarations at the top * level. Previously it scanned every trimmed line of the raw source, so: * - a `(` or `}` inside a string or comment tripped the delimiter check and * the whole file indexed empty (`strings.Split(s, "(")` is enough); * - every `var x` / `type t` local inside a function body became a * package-level symbol; * - generic functions (`func Map[T any](`) were missing, grouped * `const ( … )` / `var ( … )` members were missing, and methods were * scoped `pkg.Name` instead of the native parser's `pkg.Recv.Name`. */ export declare function parseGoWithoutToolchain(filePath: string, content: string, lang?: SymbolLang): FileSymbols; //# sourceMappingURL=go-parser.d.ts.map