Sha256: 06b9c482b9588c25cad83767cd3ce0dd5d300b37953b4191901eb382f729cd3b
Contents?: true
Size: 1.83 KB
Versions: 5
Compression:
Stored size: 1.83 KB
Contents
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>ACE Autocompletion demo</title> <style type="text/css" media="screen"> body { overflow: hidden; } #editor { margin: 0; position: absolute; top: 0; bottom: 0; left: 0; right: 0; } </style> </head> <body> <pre id="editor"></pre> <!-- load ace --> <script src="../src/ace.js"></script> <!-- load ace language_tools extension --> <script src="../src/ext-language_tools.js"></script> <script> var langagueTools = require("ace/ext/language_tools"); var editor = ace.edit("editor"); editor.session.setMode("ace/mode/html"); editor.setTheme("ace/theme/tomorrow"); // enable autocompletion and snippets editor.setOptions({ enableBasicAutocompletion: true, enableSnippets: true, enableLiveAutocompletion: false }); //editor.completers.length = 0 editor.completers.push({ getCompletions: function(editor, session, pos, prefix, callback) { setTimeout(function() { callback(null, [{ // string used for filtering value: "customCompletion", // optional, allows to display a caption different from value caption: "!!customCompletion!!", // optional, snippet that can be inseted instead of value snippet: "${2}insert${1:This}${2}Instead$0", // short description meta: "foo" }, { value: "customCompletion2" }]); }, 500); } }); </script> <script src="./show_own_source.js"></script> </body> </html>
Version data entries
5 entries across 5 versions & 1 rubygems