Enable and disable local auto completers in ace editor not working for the first time

453 views
Skip to first unread message

Priyanka Patnala

unread,
Jun 4, 2019, 6:39:45 AM6/4/19
to Ajax.org Cloud9 Editor (Ace)
Hi

I am using ace-editor in my javascript code. I am using a custom completer for my code. I tried to disable and enable the local autocompleters like (textCompleter, keywordCompleter and SnippetCompleter) based on the scenario. I am changing the editor.completers property for enable/disable the local completers.  

Here is some code:

// For removing local autocompleters
completers.forEach(function (compelter) {
    editor.completers.splice(editor.completers.indexOf(compelter), 1);
});

// For adding them back to completers list
completers.forEach(function (completer) {
    editor.completers.push(completer);
});

But the problem is even I removed the local completers, for the first time,I am getting local keywords in suggestions while I do ctrl+space.
From the second time it is working fine. I could not understand why it is showing local suggestions even I removed them from editor.completers for the first time.

Can anyone please help me to solve this issue

Thanks in Advance
Priyanka

Rob S

unread,
Jun 4, 2019, 10:25:23 AM6/4/19
to ace-d...@googlegroups.com
I just removed the first two (default) completers, and then added my own.  That worked for me.

Rob

--
You received this message because you are subscribed to the Google Groups "Ajax.org Cloud9 Editor (Ace)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ace-discuss...@googlegroups.com.
To post to this group, send email to ace-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/ace-discuss.
To view this discussion on the web visit https://groups.google.com/d/msgid/ace-discuss/2c3a31a3-a198-4e4d-a47e-22eaa1584eb0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages