Skip to content

AutoComplete

Defined in: extensions/autocomplete/types.ts:3

AutoComplete(editor, options): any

Defined in: extensions/autocomplete/types.ts:3

PrismEditor<{ }>

EditorOptions<{ }>

any

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.

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.

void


startQuery(explicit?): void

Defined in: extensions/autocomplete/types.ts:10

Starts a completion query.

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.

void