Trouble embedding Custom Syntax Highlighter for my projects “language” in my project

20 views
Skip to first unread message

M G

unread,
Apr 8, 2021, 5:56:10 AMApr 8
to Ajax.org Cloud9 Editor (Ace)

I’m creating a language highlighter for my project’s “language” that I have yet to create the regex for and I’m at the in proof of concept stage.

I have it preliminarily working in the local /tool/mode_creator.html  where I figured out how to create the demo data to load and the 


./lib/ace/mode/mylanguage_highlight_rules,js 

and the 

./lib/ace/mode/mylanguage.js 

but, now I want to see it running in my project.  I read that I need to embed it I need to use src-min-noconflict/ace.js

var editor = ace.edit("editor");

editor.session.setMode("ace/mode/mylanguage");


But my problem is that it’s trying to load  ./src-min-noconflict/mode-mylanguage.js


A variation of the mylanguage_highlight_rules,js where they look minified and altered.


ace.define("ace/mode/ini_highlight_rules"
vs
define(function(require, exports, module)

I understand the need for encapsulation to avoid conflicts, but do I have to manually create the encapsulated version?  

I thought maybe this command might generate it 

node tmlanguage.js  ../lib/ace/mode/mylanguage.js

But it yields -> 

TypeError: Cannot read property 'onMatch' of undefined

Which I’ve spent time hunting for definition of what I'm missing and can’t figure out what I’m doing wrong.

It’s so simple a monkey could do it, sadly, I’m not a monkey.  If I figure it out, I’ll post the answer, otherwise, maybe can’t use this… it looks like a powerful tool.

I hate asking for help.  Appreciate your time

Reply all
Reply to author
Forward
0 new messages