Ace编辑器自动完成和多种语言 [英] Ace Editor autocomplete and multiple languages

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

问题描述

如何创建一个自动完成功能,以及如何突出显示PHP中的html,javascript和css以供Ace编辑器使用 http:// ace.ajax.org/

 < html> 
< head>
< title><?= $ title; ?>< /标题>
< style>
body {
background:black;
颜色:白色;
}
< / style>
< script>
alert(这只是一个无意义的测试脚本....);
< / script>
< / head>
< body>
这只是一个无意义的测试脚本,但我希望html标记,css样式和javascript代码都突出显示....< br />
是否有可能?
< / body>
< / html>

(对不起,我的英语)

解决方案

以下是两个问题。如何创建完成PHP的自动完成器? b $ b

对于第二个问题,在 Google编辑器编辑器在我看来,如果可能或不可能,最不可能的。查看荧光笔文档,尤其是关于嵌入不同的荧光笔部分。

对于自动完成,我没有看到任何机会。有关类似(最近)的问题,请参阅 Google小组条目

How can I create an autocomplete and how to highlight html, javascript and css inside php for the Ace editor http://ace.ajax.org/.

<html>
    <head>
        <title><?=$title; ?></title>
        <style>
            body {
                background: black;
                color: white;
            }
        </style>
        <script>
            alert("this is only a no-sense test script....");
        </script>
    </head>
    <body>
        This is only a no-sense test script but I want that html tags, css styles and javascript code are highlighted....<br />
        Is it possible?
    </body>
</html>

(sorry for my english)

解决方案

These are two questions.

  1. How can I create an autocompleter that completes PHP?

  2. How can I syntax highlight HTLM code inside PHP code?

For the second question, there is some discussion in the Google group for Ace Editor In my opinion, the question is not really answered if it is possible or not, but it seems at least doable. Have a look at the documentation for highlighter, especially about the part "Embedding a different highlighter".

For autocompletion, I don't see a chance at all. See the Google group entry about a similar (recent) question.

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

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