import * as LSP from 'vscode-languageserver';
import * as Parser from 'web-tree-sitter';
/**
 * The Analyzer uses the Abstract Syntax Trees (ASTs) that are provided by
 * tree-sitter to find definitions, reference, etc.
 */
export default class Analyzer {
    private parser;
    private console;
    private uriToTextDocument;
    private uriToTreeSitterTrees;
    private uriToFileContent;
    private uriToDeclarations;
    private treeSitterTypeToLSPKind;
    constructor({ console, parser, }: {
        console: LSP.RemoteConsole;
        parser: Parser;
    });
    /**
     * Initiates a background analysis of the files in the given rootPath to
     * enable features across files.
     */
    initiateBackgroundAnalysis({ rootPath, }: {
        rootPath: string;
    }): Promise<{
        filesParsed: number;
    }>;
    /**
     * Find all the locations where something has been defined.
     */
    findDefinition({ word }: {
        word: string;
    }): LSP.Location[];
    /**
     * Find all the symbols matching the query using fuzzy search.
     */
    search(query: string): LSP.SymbolInformation[];
    getExplainshellDocumentation({ params, endpoint, }: {
        params: LSP.TextDocumentPositionParams;
        endpoint: string;
    }): Promise<{
        helpHTML?: string;
    }>;
    /**
     * Find all the locations where something named name has been defined.
     */
    findReferences(name: string): LSP.Location[];
    /**
     * Find all occurrences of name in the given file.
     * It's currently not scope-aware.
     */
    findOccurrences(uri: string, query: string): LSP.Location[];
    /**
     * Find all symbol definitions in the given file.
     */
    findSymbolsForFile({ uri }: {
        uri: string;
    }): LSP.SymbolInformation[];
    /**
     * Find symbol completions for the given word.
     *
     * TODO: if a file is not included we probably shouldn't include it declarations from it.
     */
    findSymbolsMatchingWord({ exactMatch, word, }: {
        exactMatch: boolean;
        word: string;
    }): LSP.SymbolInformation[];
    /**
     * Analyze the given document, cache the tree-sitter AST, and iterate over the
     * tree to find declarations.
     *
     * Returns all, if any, syntax errors that occurred while parsing the file.
     *
     */
    analyze(uri: string, document: LSP.TextDocument): LSP.Diagnostic[];
    /**
     * Find the node at the given point.
     */
    private nodeAtPoint;
    /**
     * Find the full word at the given point.
     */
    wordAtPoint(uri: string, line: number, column: number): string | null;
    /**
     * Find the name of the command at the given point.
     */
    commandNameAtPoint(uri: string, line: number, column: number): string | null;
    /**
     * Find a block of comments above a line position
     */
    commentsAbove(uri: string, line: number): string | null;
    getAllVariableSymbols(): LSP.SymbolInformation[];
    private getAllSymbols;
}
