Adds a CodeArea styled element that is a full-fledged code editor supporting syntax highlighting of many languages and code completion of a few. Additionally, this allows the use of CodeArea as a preference type for widgets/operators (allowing to specify the language) as well as TextArea.
For this to be possible, the monaco editor has been used (MIT License), which is the same that VS Code uses (it is extracted from its source code). In case monaco fails to load, the CodeArea will be a simple TextArea.
Types of changes
What types of changes does your code introduce to the project:
[ ] Bugfix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[x] I have added tests that prove my fix is effective or that my feature works
[x] I have added necessary documentation
[x] Any dependent changes have been merged and published in downstream modules
Further comments
For monaco to be loaded, webpack has been used. A script was created so that a single command (docs in README) can build monaco and prepare it for Wirecloud.
~This is still a work in progress, as tests are still missing.~ This is ready for review.
coverage: 88.985% (+0.001%) from 88.984%
when pulling 20dd55e9413cbc875002bcb996dcce4e19965898 on oxixes:v2-editor
into 01e171aa34fcf4b81b39c4aae8734b931bc35cb9 on Wirecloud:develop.
Proposed changes
Adds a
CodeArea
styled element that is a full-fledged code editor supporting syntax highlighting of many languages and code completion of a few. Additionally, this allows the use ofCodeArea
as a preference type for widgets/operators (allowing to specify the language) as well asTextArea
.For this to be possible, the monaco editor has been used (MIT License), which is the same that VS Code uses (it is extracted from its source code). In case monaco fails to load, the CodeArea will be a simple
TextArea
.Types of changes
What types of changes does your code introduce to the project:
Checklist
Further comments
For monaco to be loaded, webpack has been used. A script was created so that a single command (docs in README) can build monaco and prepare it for Wirecloud.
~This is still a work in progress, as tests are still missing.~ This is ready for review.
Happy coding!