I've been playing around with sublime-syntax files in attempt to get Ion syntax highlighting working by using as template this
C.syntax-definition. The bad news is that I didn't figured out how the file works (yet). The good news is that, with some minor changes, it is possible to get large Ion syntax coverage.
What was changed?
Basically 3 things:
1st, At the top of the file:
| name: C
file_extensions:
- c
- h
|
changed to
| name: Ion
file_extensions:
- ion
|
2nd, the key 'basic_types' under 'variables', in line 11:
| basic_types: 'asm|__asm__|auto|bool|_Bool|char|_Complex|double|float|_Imaginary|int|long|short|signed|unsigned|void'
|
changed to include all ion basic types (the example below requires verification):
| basic_types: 'bool|char|schar|uchar|double|float|int|uint|uintptr||long|ulong|llong|ullong|short|ushort|signed|unsigned|void'
|
And 3rd, every scope name terminated in .c got replaced by .ion. Example:
| - match: ^/\* =(\s*.*?)\s*= \*/$\n?
scope: comment.block.c
captures:
1: meta.toc-list.banner.block.c
|
becomes
| - match: ^/\* =(\s*.*?)\s*= \*/$\n?
scope: comment.block.ion
captures:
1: meta.toc-list.banner.block.ion
|
To add this definition in ST, you must:
1. Install the Sublime Text package PackageDev;
2. After installation, click on "New Syntax Definition..." under Tools>Packages>PackageDevelopment menu;
3. A new template syntax will be created, but you can replace its contents with the C.sublime-syntax file contents (change it as above);
4. Save it and enjoy.
P.S.: Sorry for any bad english in the text.