Ace editor autocomplete custom functions

1,737 views
Skip to first unread message

Chris Ainsley

unread,
Jun 1, 2015, 9:35:18 AM6/1/15
to ace-d...@googlegroups.com
Hello,

I'm writing to ask if there is a way for the autocomplete function in Ace editor to be used to execute an arbitary function, which is not linked to replacing code in the editor? This type of completion should be able to appear alongside regular completions snippets/custom/keyword/etc.

Chris

Harutyun Amirjanyan

unread,
Jun 1, 2015, 9:49:49 AM6/1/15
to ace-d...@googlegroups.com
Hi

Yes, It is possible, see https://github.com/ajaxorg/ace/blob/v1.1.9/lib/ace/autocomplete.js#L183.
Add insertMatch method to your completer and set `completer: this` on data returned from it.

 Ace editor to be used to execute an arbitary function, which is not linked to replacing code in the editor
just out of curiosity, what is it going to do instead of replacing text?
Reply all
Reply to author
Forward
0 new messages