/** * Shared utilities for the Swift source-bridging tools. * * Position-finding via local regex pre-scan is the load-bearing trick: we * locate the symbol's declaration in a candidate file with a quick regex * before sending its position to SourceKit-LSP. This avoids LSP's * comparatively slow workspace symbol search. */ export interface SymbolPosition { line: number; character: number; matchedText: string; } /** * Find the first declaration of `symbolName` in the file. * * Looks for the symbol after one of Swift's declaration keywords * (`class`, `struct`, `enum`, `protocol`, `func`, `var`, `let`, * `actor`, `extension`). Falls back to the first standalone-word * occurrence so we still surface a position when the name is referenced * but not declared in the file (e.g. an extension method on a type * declared elsewhere). * * Returns 0-based positions matching LSP's convention. */ export declare function findSymbolDeclaration(filePath: string, symbolName: string): SymbolPosition | null; export declare function escapeRegex(s: string): string; /** Extract a few lines of context around `line` for snippet display. */ export declare function snippetAt(filePath: string, line: number, padding?: number): string;