Current suggestion context, containing the result of
This will be null any time the EditorSuggest is not supposed to run.
Override this to use a different limit for suggestion items
setInstructions(instructions: Instruction): void;
abstract onTrigger(cursor: EditorPosition, editor: Editor, file: TFile): EditorSuggestTriggerInfo | null;
Based on the editor line and cursor position, determine if this EditorSuggest should be triggered at this moment. Typically, you would run a regular expression on the current line text before the cursor. Return null to indicate that this editor suggest is not supposed to be triggered.
Please be mindful of performance when implementing this function, as it will be triggered very often (on each keypress). Keep it simple, and return null as early as possible if you determine that it is not the right time.
abstract getSuggestions(context: EditorSuggestContext): T | Promise<T>;
Generate suggestion items based on this context. Can be async, but preferably sync. When generating async suggestions, you should pass the context along.