EditorSuggest

EditorSuggest class

Signature:

export abstract class EditorSuggest<T> extends PopoverSuggest<T> 

Extends: PopoverSuggest<T>

Constructors

ConstructorModifiersDescription
(constructor)(app)Constructs a new instance of the EditorSuggest class

Properties

PropertyModifiersTypeDescription
appApp

(Inherited from PopoverSuggest)

contextEditorSuggestContext | nullCurrent suggestion context, containing the result of onTrigger. This will be null any time the EditorSuggest is not supposed to run.
limitnumberOverride this to use a different limit for suggestion items
scopeScope

(Inherited from PopoverSuggest)

Methods

MethodModifiersDescription
close()

(Inherited from PopoverSuggest)

getSuggestions(context)abstractGenerate 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)