enable autocompletion and snippets
This commit is contained in:
parent
a69fce21f4
commit
8a22cf4873
2 changed files with 24 additions and 1 deletions
|
|
@ -112,7 +112,7 @@ Or using Node.JS
|
||||||
|
|
||||||
The editor can then be opened at http://localhost:8888/kitchen-sink.html.
|
The editor can then be opened at http://localhost:8888/kitchen-sink.html.
|
||||||
|
|
||||||
To open the editor with a file:/// URL see [the wiki](https://github.com/ajaxorg/ace/wiki/Running-Ace-from-a-file:).
|
To open the editor with a file:/// URL see [the wiki](https://github.com/ajaxorg/ace/wiki/Running-Ace-from-file).
|
||||||
|
|
||||||
Building Ace
|
Building Ace
|
||||||
-----------
|
-----------
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,29 @@ $(function() {
|
||||||
editor.session.setMode("ace/mode/javascript");
|
editor.session.setMode("ace/mode/javascript");
|
||||||
editor.session.setMode("ace/mode/javascript");
|
editor.session.setMode("ace/mode/javascript");
|
||||||
embedded_editor.session.setMode("ace/mode/html");
|
embedded_editor.session.setMode("ace/mode/html");
|
||||||
|
|
||||||
|
ace.config.loadModule("ace/ext/emmet", function() {
|
||||||
|
ace.require("ace/lib/net").loadScript("http://nightwing.github.io/emmet-core/emmet.js", function() {
|
||||||
|
embedded_editor.setOption("enableEmmet", true);
|
||||||
|
editor.setOption("enableEmmet", true);
|
||||||
|
});
|
||||||
|
|
||||||
|
embedded_editor.setOptions({
|
||||||
|
enableSnippets: true,
|
||||||
|
enableBasicAutocompletion: true
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
ace.config.loadModule("ace/ext/language_tools", function() {
|
||||||
|
embedded_editor.setOptions({
|
||||||
|
enableSnippets: true,
|
||||||
|
enableBasicAutocompletion: true
|
||||||
|
});
|
||||||
|
editor.setOptions({
|
||||||
|
enableSnippets: true,
|
||||||
|
enableBasicAutocompletion: true
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
embedded_editor.setAutoScrollEditorIntoView(true);
|
embedded_editor.setAutoScrollEditorIntoView(true);
|
||||||
editor.setAutoScrollEditorIntoView(true);
|
editor.setAutoScrollEditorIntoView(true);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue