Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using multiple ace editor instances with different completers

how could I set up individual completers per ace editor instance?

I am using multiple editors in my application. - setting completers on the languageTools object seems to just add duplicates for all editor instances at once

     langTools.addCompleter(myCompleter);
  • setting completers directly on the editor seems to produce the same result.

    editor.completers.push(myCompleter);

(All editors should keep their default completers)

like image 233
zbug Avatar asked Apr 17 '26 12:04

zbug


1 Answers

In my second example, the completers were handed by reference, so I was always adding completers to the central list of completers, which ended up in duplicates.

This works:

editor.completers = editor.completers.slice();
editor.completers.push(myCompleter);
like image 154
zbug Avatar answered Apr 19 '26 01:04

zbug