I cannot get getCompletions function to run in my custom add-on when using custom extract pregex identifier identifierRegexps prefix
Basically I am trying to create an autorun that will run in periods (.) Preceded by letters. For instance. In the "foo". when a period is set, I would like to present my own suggestions.
var lang = ace.require("ace/ext/language_tools"); var editor = ace.edit("editor"); editor.getSession().setMode("ace/mode/javascript"); editor.setOptions({ enableBasicAutocompletion: true, enableSnippets: true, enableLiveAutocompletion: true }); var compl = { identifierRegexps: [/[a-zA-Z_0-9\.\$\-\u00A2-\uFFFF]/], getCompletions: function (editor, session, pos, prefix, callback) { alert(prefix); callback(null, []); return; } } lang.addCompleter(compl);
With the above snippet, a pop-up window appears with suggestions when entering a point, but getCompletions does not start. However, it works for any other character.
UPDATE:
Removing default add-ons before adding custom with
lang.setCompleters();
calls the getCompletion function. However, the prefix argument is empty in this case.
source share