问题描述
我发现simmilar问题:
I've found simmilar question: Ace Editor autocomplete and multiple languages
但反应是自动完成这不是由ACE根据谷歌组王牌编辑器的支持,这是我为wishlish王牌,我们明确地需要它
为Cloud9。
But the responses were that autocompletion is not supported by ACE, and according to Google group for Ace Editor "It is on my wishlish for Ace and we definitively need itfor Cloud9".
这是后一岁,正如你所看到的,cloud9现在支持自动完成:
This post is one year old and as you can see, the cloud9 supports autocompletion now:https://c9.io/site/features/
原来是自动完成的王牌编辑器默认提供的?我找不到它的任何信息。
So is autocompletion available in Ace Editor by default? I cannot find any information about it.
推荐答案
自动完成,现在是API的正式组成部分。启用需要3线code的:
Autocomplete is now an official part of the API. Enabling it takes 3 lines of code:
ace.require("ace/ext/language_tools");
var editor = ace.edit("editor");
editor.setOptions({
enableBasicAutocompletion: true
});
根据您的设置与要求,JS,你可能还需要包括一个额外的JavaScript文件中的HTML您的网页:
Depending on your setup with require-js, you may also need to include an additional javascript file in the html for your page:
<script src="ace/ext-language_tools.js"></script>
您可以找到一个演示https://github.com/ajaxorg/ace/blob/master/demo/autocompletion.html
和这里的wiki页面我刚才的话题说:
And here's the wiki page I just wrote on the topic:
https://github.com/ajaxorg/ace/wiki/How-to-enable-Autocomplete-in-the-Ace-editor
这篇关于自动完成在ACE编辑器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!