Closed javierfernandes closed 8 years ago
@flbulgarelli @faloi what do you need for this ?
Where can I take a look for other examples of syntax highlight for other languages ?
Hi! We need support for Ace editor format, and Github Flavoured markdown format
I guess that one needs to create a new Ace editor mode
https://github.com/ajaxorg/ace/wiki/Creating-or-Extending-an-Edit-Mode
Although Ace page says Sublime hightlight can be imported into Ace. We already have one of that
Example custom ace mode for bash
Although Ace page says Sublime hightlight can be imported into Ace. We already have one of that
Here is the HOW-TO, updated on September 2012 :worried:. Can you give it a try?
I created a new one based on Java's mode in Ace
It still requires manual work to maintain. And I had to copy paste java mode code which has a lot of code that I don't fully understand, but it works relatively well.
I need to:
See how Mumuki can use this mode (maybe I can create a PR for ace repo so that they can include wollok mode by default ?)
Yes, let's try that first. Modes are not pluggable, so to include it we have to fork many repositories (Ace, the gem that provides Ace on Rails, etc).
rails :S
Here is an example PR for drools
Ok. I think that I already have it ready for creating a PR to ace. I was able to create a test and run it successfully.
I have also contributed with code snippets which allows to have a basic autocomplete !! Look !
@npasserini @faloi @flbulgarelli
To enabled this you should include this in mumuki html
<script src="/Users/jfernandes/dev/data/repo/wollok/ace-editor/wollok-ace/build/src/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="/Users/jfernandes/dev/data/repo/wollok/ace-editor/wollok-ace/build/src/ext-language_tools.js" type="text/javascript" charset="utf-8"></script>
<script>
var editor = ace.edit("editor");
//editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/wollok");
editor.setOptions({
enableBasicAutocompletion: true
});
</script>
(disregard my local path, the second js
PR created https://github.com/ajaxorg/ace/pull/2776
Awesome
PR closed !
Awesome!
On Wollok side I will create a small generic app that will generate what mumuki needs based on the xtext grammar, so that we don't need to manually maintain another file and apply changes every time we update the wollok grammar. I already know how to generate a list of wollok keywords dynamically.
I might also publish this as a separated tool for any xtext language, to contribute to xtext community, if the output is generic enough.