yabab-dev / ng2-codemirror

Angular2 CodeMirror component
MIT License
70 stars 30 forks source link

Add custom keyword as hightlighted syntax #30

Open DarienChoo opened 7 years ago

DarienChoo commented 7 years ago

I am currently using mode "text/x-mysql", I'm wondering how can I add custom keyword (e.g. UPPER, LOWER, etc) which will be highlighted as syntax (SELECT, FROM, etc)

I have this config:

this.config = { lineNumbers: true, mode: 'text/x-mysql', extraKeys: { "Ctrl-Space": "autocomplete" }, theme: 'eclipse', hintOptions: { tables: { "table1": ["col_A", "col_B", "col_C"], "table2": ["other_columns1", "other_columns2"] } } };

Thanks.