[英]How to make an intellisense for array type json in ACE.js editor?
我一直在將Ace.js用於我的JavaScript編輯器。 我創建了一個js文件,以使我的ace編輯器成為自動完成程序。
autoCompleter的MyJs文件:
var editorDefinitions = {
"!name": "myeditor",
"profilVerileri":
[{ "test": "fsdf", "id": "1" }, { "test": "fsdf", "id": "2" }, { "test": "dasd", "id": "3" }],
但是我的數組自動完成程序不起作用。 往下看 :
如果您查看我想要的自動完成器:
在按下“ profilVerileri [i]”后,“ test”應自動完成。
我的整個代碼是:
var defs = [editorDefinitions];
var ternServer = new TernServer({
defs: defs
});
editor.ternTooltip = new TernTooltip(editor, ternServer);
LangTools.addCompleter(ternServer);
editor.setOptions({
enableBasicAutocompletion: true
});
editor.focus();
您可能需要打開實時自動補全功能
editor.setOptions({
enableBasicAutocompletion: true,
enableLiveAutocompletion: true,
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.