Recently, I integrated Ace.js into my development workflow as a JavaScript editor. I even went ahead and created a custom JS file to enhance the functionality of my Ace editor with an autocompleter feature.
Here's a snippet from my personalized autoCompleter JS file:
var editorDefinitions = {
"!name": "myeditor",
"profilVerileri":
[{ "test": "fsdf", "id": "1" }, { "test": "fsdf", "id": "2" }, { "test": "dasd", "id": "3" }],
Despite my efforts, I faced an issue where the autocompleter for arrays wasn't working as expected. See below for more details:
If you take a look at what I envision for the autocompleter:
"test" should be suggested after typing 'profilVerileri[i].'
Below is a glimpse of my complete code setup:
var defs = [editorDefinitions];
var ternServer = new TernServer({
defs: defs
});
editor.ternTooltip = new TernTooltip(editor, ternServer);
LangTools.addCompleter(ternServer);
editor.setOptions({
enableBasicAutocompletion: true
});
editor.focus();