拼写错误的 Ace 编辑器选项 [英] Misspelled Ace Editor Options

查看:56
本文介绍了拼写错误的 Ace 编辑器选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为 PHP 实现了 Ace 编辑器设置(工作正常),但是当我尝试使用 Ace 的 API 设置其他选项时,我在控制台中收到警告.

I have implemented an Ace editor setup for PHP (which is working fine), but when I try to set additional options using Ace's API, I receive warnings in the console.

这是用于初始化编辑器并尝试设置选项的代码;

Here is the code used to init the editor and try to set the options;

ace.require("ace/ext/language_tools");
ace.require("ace/ext/emmet");

// PHP
var phpeditor = ace.edit("php_inc");
phpeditor.setTheme("ace/theme/dreamweaver");
phpeditor.getSession().setMode("ace/mode/php");
phpeditor.setOptions({
        enableSnippets: true,
        enableLiveAutoComplete: true,
        enableBasicAutocompletion: true,
        showPrintMargin: settings.showPrintMargin,
        useSoftTabs: false,
        fontSize: settings.fontSize,
        showInvisibles: settings.showInvisibles,
        behavioursEnabled: settings.behavioursEnabled,
        tabSize: settings.tabSize,
        useWrapMode: settings.useWrapMode,
        useWorker: settings.useWorker,
        setHighlightActiveLine: false,
        enableEmmet: true
    });

这是我得到的控制台警告;

And here are the console warnings I get;

misspelled option "enableSnippets" ace.js?ver=3.9.1:5207
misspelled option "enableLiveAutoComplete" ace.js?ver=3.9.1:5207
misspelled option "enableBasicAutocompletion" ace.js?ver=3.9.1:5207
misspelled option "setHighlightActiveLine" ace.js?ver=3.9.1:5207
misspelled option "enableEmmet" ace.js?ver=3.9.1:5207

任何帮助将不胜感激.

推荐答案

  1. 您需要包含您使用的扩展的脚本文件,请参阅https://github.com/ajaxorg/ace-builds/blob/v1.1.4/demo/autocompletion.html#L28
  2. 选项名称是 "enableLiveAutocompletion" 而不是 "enableLiveAutoComplete" https://github.com/ajaxorg/ace/blob/v1.1.4/lib/ace/ext/language_tools.js#L186
  3. 选项名称中没有 set 所以它应该是 highlightActiveLine
  1. you need to include script files for extensions you use see https://github.com/ajaxorg/ace-builds/blob/v1.1.4/demo/autocompletion.html#L28
  2. option name is "enableLiveAutocompletion" instead of "enableLiveAutoComplete" https://github.com/ajaxorg/ace/blob/v1.1.4/lib/ace/ext/language_tools.js#L186
  3. options names do not have set in them so it should be highlightActiveLine

您可以通过运行 Object.keys(editor.$options)

这篇关于拼写错误的 Ace 编辑器选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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