import { CompletionItem } from 'vscode-languageserver'; import { TokenStream } from 'antlr4ts'; export declare function completionsFor(text: string, line: number, column: number): CompletionItem[]; export declare function lastX(array: T[]): T | undefined; export type CursorPosition = { line: number; column: number; }; /** * @returns the token index for which we want to provide completion candidates, * which depends on the cursor possition. * * @example * ```soql * SELECT id| FROM x : Cursor touching the previous identifier token: * we want to continue completing that prior token position * SELECT id |FROM x : Cursor NOT touching the previous identifier token: * we want to complete what comes on this new position * SELECT id | FROM x : Cursor within whitespace block: we want to complete what * comes after the whitespace (we must return a non-WS token index) * ``` */ export declare function findCursorTokenIndex(tokenStream: TokenStream, cursor: CursorPosition): number | undefined; export interface SoqlItemContext { sobjectName: string; relationshipName?: string; fieldName?: string; onlyTypes?: string[]; onlyAggregatable?: boolean; onlyGroupable?: boolean; onlySortable?: boolean; onlyNillable?: boolean; mostLikelyItems?: string[]; dontShowRelationshipField?: boolean; }