我知道Codiad使用ace编辑器,如何在codiad中实现这个(下面)ace编辑器的Javascript:
editor.setOptions({
enableBasicAutocompletion: true,
enableSnippets: true,
enableLiveAutocompletion: true
});
答案 0 :(得分:1)
我自己找到了解决方案。 首先我需要添加
<script src="components/editor/ace-editor/ext-language_tools.js"></script>
。然后编辑&#39; component / editor / init.js&#39;并在下面&#39;应用配置&#39;评论编辑: 老:
applySettings: function(i) {
// Check user-specified settings
this.getSettings();`
// Apply the current configuration settings:
i.setTheme('ace/theme/' + this.settings.theme);
i.setFontSize(this.settings.fontSize);
i.setPrintMarginColumn(this.settings.printMarginColumn);
i.setShowPrintMargin(this.settings.printMargin);
i.setHighlightActiveLine(this.settings.highlightLine);
i.setDisplayIndentGuides(this.settings.indentGuides);
i.getSession().setUseWrapMode(this.settings.wrapMode);
this.setTabSize(this.settings.tabSize, i);
this.setSoftTabs(this.settings.softTabs, i);
i.setOptions({
enableBasicAutocompletion: true,
enableSnippets: true,
enableLiveAutocompletion: true
});
},
如:
applySettings: function(i) {
// Check user-specified settings
this.getSettings();
// Apply the current configuration settings:
i.setTheme('ace/theme/' + this.settings.theme);
i.setFontSize(this.settings.fontSize);
i.setPrintMarginColumn(this.settings.printMarginColumn);
i.setShowPrintMargin(this.settings.printMargin);
i.setHighlightActiveLine(this.settings.highlightLine);
i.setDisplayIndentGuides(this.settings.indentGuides);
i.getSession().setUseWrapMode(this.settings.wrapMode);
this.setTabSize(this.settings.tabSize, i);
this.setSoftTabs(this.settings.softTabs, i);
i.setOptions({
enableBasicAutocompletion: true,
enableSnippets: true,
enableLiveAutocompletion: true
});
},