EditorSuggest class
Signature:
export abstract class EditorSuggest<T> extends PopoverSuggest<T>
Extends: PopoverSuggest
<T>
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(app) | Constructs a new instance of the EditorSuggest class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
app | App | (Inherited from PopoverSuggest) | |
context | EditorSuggestContext | null | Current suggestion context, containing the result of onTrigger . This will be null any time the EditorSuggest is not supposed to run. | |
limit | number | Override this to use a different limit for suggestion items | |
scope | Scope | (Inherited from PopoverSuggest) |
Methods
Method | Modifiers | Description |
---|---|---|
close() | (Inherited from PopoverSuggest) | |
getSuggestions(context) | abstract | Generate suggestion items based on this context. Can be async, but preferably sync. When generating async suggestions, you should pass the context along. |
onTrigger(cursor, editor, file) | abstract | 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. |
open() | (Inherited from PopoverSuggest) | |
renderSuggestion(value, el) | abstract | (Inherited from PopoverSuggest) |
selectSuggestion(value, evt) | abstract | (Inherited from PopoverSuggest) |
setInstructions(instructions) |