Code Editor Cc467b9
Code Editor Cc467b9
cc467b9a1c574410ac4a08a5dc2f55a2
view on: demo kit nightly build | demo kit latest release
Code Editor
The sap.ui.codeeditor.CodeEditor offers functionality to display and edit source code
artifacts with syntax highlighting and code completion capabilities for various
programming languages.
Overview
The sap.ui.codeeditor.CodeEditor provides simple OpenUI5 wrapper control that
exposes a subset of API and functionality provided by the third-party ACE (Ajax.org Cloud9
Editor) implementation. You can find more information about ACE on the website
https://ace.c9.io/.
Note: - If you use API calls to the native API of ACE, we cannot guarantee backwards compatibility after an upgrade
to higher ACE library versions.
• Accessibility features like high-contrast themes and keyboard handling are not fully available as they are for
the rest of the OpenUI5 controls.
• CodeEditor doesn’t work within IconTabBar on Internet Explorer. However, there is a way to achieve
the same functionality. For more information, see the Sample.
Details
Autocompletion
The sap.ui.codeeditor.CodeEditor control is enabled with two modes of autocompletion:
• Default autocompletion
• Custom autocompletion
The users of CodeEditor can specify their own autocompletion handling. To do this, the
following API method is provided:
CodeEditor.prototype.addCustomCompleter(oCustomCompleter) .
There are several characteristics you should bear in mind:
– The method accepts two parameters: fnCallback and context object. Callback
should be called, as in the example, with the suggestions that you want to
appear in the editor. The format is an array of objects. Each object should
contain the following properties: name, value, score and meta.
– The context object contains oPos and sPrefix as provided by the ACE editor.