The IDE can now load highlighter definition files containing textmate grammar. (mostly).
EDIT: IDE => Lazarus 3.99
There are some items still missing
- nested grammar/language (include using a 2nd grammar) (todo)
- folding (todo)
- There is also no support for "injections" (just edit the grammar and copy the injection into the final place).
Known differences:
- The regex engine does not support the full range of operations. So some existing grammars may fail on that (or behave different).
- SynEdit does not store newlines chars => patterns matching "\n" must be changed to match "$" instead.
Installation:
- Add the json file to PCP/usersessions/tml/
Files will be loaded at IDE startup. IDE must be restarted to load new files.
- The IDE will show it in the highlighter list
Or it will show it on the "color tml" page, if there is an error in the file
It is recommanded to edit/amend the files (if you copy existing grammars).
- to get text in the preview of the options, add (top level) either
"sampleText": "foo bar some text"
"sampleTextFile": "/foo/bar/file"
- simplify the naming. Existing files contain name like
"name": "comment.block.pascal",
"name": "comment.line.pascal",
You may want to replace them, with one name for all comments (keep one dot, as it will detect "comment.*" for default colors).
"name": "comment.pascal",
Please test (if interested in the feature). Thanks