自动完成在ACE编辑器 [英] Autocompletion in ACE editor

查看:1842
本文介绍了自动完成在ACE编辑器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现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 it for Cloud9".

这是后一岁,正如你所看到的,cloud9现在支持自动完成:
https://c9.io/site/features/

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>

您可以找到一个演示<一个href=\"https://github.com/ajaxorg/ace/blob/master/demo/autocompletion.html\">https://github.com/ajaxorg/ace/blob/master/demo/autocompletion.html

和这里的wiki页面我刚才的话题说:

And here's the wiki page I just wrote on the topic:

<一个href=\"https://github.com/ajaxorg/ace/wiki/How-to-enable-Autocomplete-in-the-Ace-editor\">https://github.com/ajaxorg/ace/wiki/How-to-enable-Autocomplete-in-the-Ace-editor

这篇关于自动完成在ACE编辑器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆