eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
865 stars 782 forks source link

Add syntax highlighting for Javascripts in script module #1560

Open kaikreuzer opened 8 years ago

kaikreuzer commented 8 years ago

It would be nice to have syntax highlighting for Javascript in the text area of the script module.

It seems that such stuff exists for angular, see http://ngmodules.org/modules/angular-highlightjs.

aounhaider1 commented 8 years ago

This library will not work in our case. It does the normal syntax highlighting in elements like divs. A textarea does not allow text formatting as such, so to implement this we need to explore some other available editor options.

lewie commented 7 years ago

I often use this powerfull and fast embeddable code editor: https://ace.c9.io/ A full featured example with 110 languages: https://ace.c9.io/build/kitchen-sink.html

lewie commented 7 years ago

@aounhaider1, @kaikreuzer, we could write highlighters for OH specific Syntax like things, channels, items, sitemaps and xText Rules etc. too.

Don't know if this BSD-license does conflict with OH2-license in front-end https://github.com/ajaxorg/ace/blob/master/LICENSE

kaikreuzer commented 7 years ago

BSD is compatible with EPL, so this should be no issue.

htreu commented 7 years ago

An alternative to ace might be tern.js.