AutoComplete
Defined in: extensions/autocomplete/types.ts:3
Extends
Section titled “Extends”AutoComplete(
editor,options):any
Defined in: extensions/autocomplete/types.ts:3
Parameters
Section titled “Parameters”editor
Section titled “editor”PrismEditor<{ }>
options
Section titled “options”EditorOptions<{ }>
Returns
Section titled “Returns”any
Methods
Section titled “Methods”insertCompletion()
Section titled “insertCompletion()”insertCompletion(
completion,start,end?):void
Defined in: extensions/autocomplete/types.ts:25
Inserts a completion option, replacing the text in the document between start and
end with the label (or insert if present) property of the completion. If the
completion has tab stops, these are displayed and can be selected by the user.
This is very useful to insert snippets since this method will preserve current
indentation on new lines and replace tabs with spaces when options.insertSpaces
isn’t set to false.
Parameters
Section titled “Parameters”completion
Section titled “completion”The completion to insert.
number
Starting position of the text replaced by the completion.
number
Ending position of the text replaced by the completion. Defaults to
start.
Returns
Section titled “Returns”void
startQuery()
Section titled “startQuery()”startQuery(
explicit?):void
Defined in: extensions/autocomplete/types.ts:10
Starts a completion query.
Parameters
Section titled “Parameters”explicit?
Section titled “explicit?”boolean
When a query is started by this extension, explicit gets set to
true whenever the query was started with Ctrl+Space, and false if the query was
started implicitly while typing.
Returns
Section titled “Returns”void