import type { IParser } from '@rcs-lang/core'; import type { ImportResolver } from '../import-resolver/index.js'; import type { WorkspaceIndex } from '../workspace-index/index.js'; /** * Represents a reference location */ export interface Reference { /** URI of the file containing the reference */ uri: string; /** Range of the reference */ range: { start: { line: number; character: number; }; end: { line: number; character: number; }; }; /** Context where the reference appears */ context?: { /** Type of context (definition, reference, import) */ type: 'definition' | 'reference' | 'import'; /** Surrounding text for context */ text?: string; }; } import type { Position, TextDocument } from './types.js'; /** * Provides "Find All References" functionality for RCL files */ export declare class ReferencesProvider { private parser; private importResolver; private workspaceIndex; constructor(parser: IParser, importResolver: ImportResolver, workspaceIndex: WorkspaceIndex); /** * Find all references to a symbol at the given position */ findAllReferences(document: TextDocument, position: Position, includeDeclaration?: boolean): Promise; /** * LSP-compatible method for finding references */ provideReferences(document: TextDocument, position: Position, context: { includeDeclaration: boolean; }): Promise; /** * Get symbol at the given position */ private getSymbolAtPosition; /** * Check if character is part of a word (includes letters, numbers, underscore) */ private isWordCharacter; /** * Find all references within the same file */ private findLocalReferences; /** * Find all references across the workspace */ private findWorkspaceReferences; /** * Find references in a specific file */ private findReferencesInFile; /** * Extract references from an AST node */ private extractReferencesFromNode; /** * Check if a node represents a definition */ private isDefinitionNode; /** * Check if a node references the given symbol */ private isReferenceNode; /** * Find the exact range of a symbol within a node */ private findSymbolRangeInNode; /** * Extract name from a definition node */ private extractNodeName; /** * Extract import path from import node */ private extractImportPath; /** * Convert AST node to LSP range */ private nodeToRange; /** * Remove duplicate references and sort by location */ private deduplicateAndSort; /** * Walk AST nodes recursively */ private walkAST; } //# sourceMappingURL=ReferencesProvider.d.ts.map