FEATURE: add JavaScript mode to ace (#27586)
This allows plugins to use Ace Editor in JavaScript mode. This will be used in Discourse AI when defining custom tools.
This commit is contained in:
parent
4cbe5e0606
commit
cb3456e18f
|
@ -27,6 +27,11 @@ module("Integration | Component | ace-editor", function (hooks) {
|
|||
assert.ok(exists(".ace_editor"), "it renders the ace editor");
|
||||
});
|
||||
|
||||
test("javascript editor", async function (assert) {
|
||||
await render(hbs`<AceEditor @mode="javascript" @content="test: true" />`);
|
||||
assert.ok(exists(".ace_editor"), "it renders the ace editor");
|
||||
});
|
||||
|
||||
test("disabled editor", async function (assert) {
|
||||
await render(hbs`
|
||||
<AceEditor @mode="sql" @content="SELECT * FROM users" @disabled={{true}} />
|
||||
|
|
|
@ -250,9 +250,15 @@ task "javascript:update" => "clean_up" do
|
|||
|
||||
ace_root = "#{library_src}/ace-builds/src-min-noconflict/"
|
||||
|
||||
addtl_files = %w[ext-searchbox mode-html mode-scss mode-sql mode-yaml worker-html].concat(
|
||||
themes,
|
||||
)
|
||||
addtl_files = %w[
|
||||
ext-searchbox
|
||||
mode-html
|
||||
mode-javascript
|
||||
mode-scss
|
||||
mode-sql
|
||||
mode-yaml
|
||||
worker-html
|
||||
].concat(themes)
|
||||
|
||||
dest_path = dest.split("/")[0..-2].join("/")
|
||||
addtl_files.each { |file| FileUtils.cp_r("#{ace_root}#{file}.js", dest_path) }
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue