import { TreeSitterService } from './tree-sitter/service.js'; import type { Tree, Language } from 'web-tree-sitter'; /** Result of parsing a file with tree-sitter. */ export interface ParseResult { tree: Tree; language: Language; lang: string; } /** A syntax-level diagnostic derived from the tree-sitter parse (no type checking). */ export interface SyntaxDiagnostic { /** 1-based line. */ readonly line: number; /** 0-based column. */ readonly column: number; readonly message: string; } import { LspService } from './lsp/service.js'; import type { SymbolInfo, OutlineEntry } from './tree-sitter/queries.js'; import type { Location, DocumentSymbol, Diagnostic, Hover } from './lsp/protocol.js'; import type { ShellPathService } from '../runtime/shell-paths.js'; /** * Convert a filesystem path to a file:// URI. * Correctly handles paths with spaces and special characters. */ export declare function pathToUri(filePath: string): string; /** * Convert a file:// URI back to a filesystem path. * Correctly handles percent-encoded URIs. */ export declare function uriToPath(uri: string): string; export declare class CodeIntelligence { private treeSitter; private lsp; private readonly shellPaths; constructor(options?: { shellPaths?: Pick | undefined; treeSitter?: TreeSitterService | undefined; lsp?: LspService | undefined; }); /** * Initialize all services. Call once at startup. * Loads language configs and registers LSP server commands with LspService * so that user/project overrides in the configured languages directory are respected. */ initialize(): Promise; /** Shutdown all owned services for this facade instance. */ dispose(): Promise; /** * Parse a file and load its tree-sitter language in one step. * Returns null if the language is unknown or grammar unavailable. */ private _parseFile; /** Detect the language of a file by its extension. */ detectLanguage(filePath: string): string | null; /** Check if a tree-sitter grammar is loaded for a file's language. */ hasTreeSitter(filePath: string): boolean; /** * Parse a file and extract symbols. * Returns empty array if no grammar is loaded for the language. */ getSymbols(filePath: string, content: string): Promise; /** * Parse a file and extract an outline (signatures only). * Returns empty array if no grammar is loaded for the language. */ getOutline(filePath: string, content: string): Promise; /** * Parse a file and return syntax-level diagnostics (ERROR / MISSING nodes) * from the tree-sitter parse. In-process and cheap, this does NOT type-check * and never spawns a language server. Returns [] when no grammar is loaded for * the language or the parse is clean. */ getSyntaxDiagnostics(filePath: string, content: string): Promise; /** * Find the scope (function/class) enclosing a line. * Returns null if unavailable. */ getEnclosingScope(filePath: string, content: string, line: number): Promise<{ kind: string; name: string; startLine: number; endLine: number; } | null>; /** Check if an LSP server is available for a file's language. */ hasLsp(filePath: string): Promise; /** * Get definition location. * Returns null if LSP not available for the file's language. */ getDefinition(filePath: string, line: number, column: number): Promise; /** * Get all references to a symbol. * Returns empty array if LSP not available. */ getReferences(filePath: string, line: number, column: number): Promise; /** * Get document symbols. * Tries LSP first; falls back to tree-sitter if LSP is unavailable. */ getDocumentSymbols(filePath: string, content: string): Promise; /** * Get hover information. * Returns null if LSP not available. */ getHover(filePath: string, line: number, column: number): Promise; /** * Get diagnostics for a file. * Returns empty array if LSP not available. * Checks queued textDocument/publishDiagnostics notifications first, then asks * servers that implement textDocument/diagnostic. */ getDiagnostics(filePath: string): Promise; } //# sourceMappingURL=facade.d.ts.map