import type { IParser } from '@rcs-lang/core'; import type { ImportResolver } from '../import-resolver/index.js'; import type { WorkspaceIndex } from '../workspace-index/index.js'; import type { Position, TextDocument } from './types.js'; /** * Completion item kinds */ export declare enum CompletionItemKind { Text = 1, Method = 2, Function = 3, Constructor = 4, Field = 5, Variable = 6, Class = 7, Interface = 8, Module = 9, Property = 10, Unit = 11, Value = 12, Enum = 13, Keyword = 14, Snippet = 15, Color = 16, File = 17, Reference = 18, Folder = 19, EnumMember = 20, Constant = 21, Struct = 22, Event = 23, Operator = 24, TypeParameter = 25 } /** * Represents a completion item */ export interface CompletionItem { /** The label displayed in the completion list */ label: string; /** The kind of completion item */ kind: CompletionItemKind; /** Optional detail information */ detail?: string; /** Documentation or description */ documentation?: string; /** Text to insert when selected */ insertText?: string; /** Range to replace when inserting */ textEdit?: { range: { start: { line: number; character: number; }; end: { line: number; character: number; }; }; newText: string; }; /** Additional text edits to apply */ additionalTextEdits?: Array<{ range: { start: { line: number; character: number; }; end: { line: number; character: number; }; }; newText: string; }>; /** Sort priority (lower values appear first) */ sortText?: string; /** Filter text for matching */ filterText?: string; } /** * Completion list with metadata */ export interface CompletionList { /** Whether the list is incomplete */ isIncomplete: boolean; /** The completion items */ items: CompletionItem[]; } /** * Provides context-aware code completion for RCL */ export declare class CompletionProvider { private parser; private importResolver; private workspaceIndex; private readonly keywords; private readonly propertyValues; constructor(parser: IParser, importResolver: ImportResolver, workspaceIndex: WorkspaceIndex); /** * Provide completion items for the given position */ provideCompletion(document: TextDocument, position: Position, triggerCharacter?: string): Promise; /** * Analyze the completion context at the given position */ private analyzeCompletionContext; /** * Provide completions for root level (agents, flows, imports) */ private provideRootCompletions; /** * Provide completions for agent context */ private provideAgentCompletions; /** * Provide completions for flow context */ private provideFlowCompletions; /** * Provide completions for property values */ private providePropertyCompletions; /** * Provide completions for transitions */ private provideTransitionCompletions; /** * Provide symbol completions from workspace */ private provideSymbolCompletions; /** * Provide import path completions */ private provideImportCompletions; /** * Provide snippet completions */ private provideSnippetCompletions; /** * Filter completions based on prefix */ private filterCompletions; /** * Determine the current scope based on line position and indentation */ private determineScope; /** * Check if position is inside a string */ private isInString; /** * Check if position is inside a comment */ private isInComment; /** * Extract available symbols from document content */ private extractAvailableSymbols; /** * Check if symbol is a state name */ private isStateSymbol; /** * Get completion kind for symbol type */ private getCompletionKindForSymbolType; /** * Get keyword documentation */ private getKeywordDocumentation; /** * Get property documentation */ private getPropertyDocumentation; /** * Get property detail information */ private getPropertyDetail; /** * Get property insert text with placeholder */ private getPropertyInsertText; /** * Get relative file path for display */ private getRelativeFilePath; /** * Get relative import path between two files */ private getRelativeImportPath; } //# sourceMappingURL=CompletionProvider.d.ts.map