Yeah, I’m certainly open to improving the upstream defaults. Feel free to open issues with concrete suggestions, so we can discuss them in a more focused manner.
1 Like
This morning I did a bit of a re-org of the font-lock defaults in neocaml, prompted by the discussion here. I haven’t addressed the specific issues we’ve been discussing, but I did notice that I actually hadn’t done some changes I thought I had already done… ![]()
In a nutshell:
- Moved
typefrom level 3 to level 2 andnumberfrom level 2 to level 3 - Split
escape-sequenceout ofstringinto its own feature at level 3 - Split
property(record fields) andlabel(labeled arguments) out ofvariableinto their own features at level 4
New layout:
| Level | Features |
|---|---|
| 1 | comment, definition |
| 2 | keyword, string, type |
| 3 | attribute, builtin, constant, escape-sequence, number |
| 4 | operator, bracket, delimiter, variable, property, label, function |
Now the defaults are actually aligned with the official Emacs suggestions, and the features are more granular and more aligned with what an OCaml programmer might want to font-lock differently.
3 Likes
FYI - Release v0.4.0 · bbatsov/neocaml · GitHub
You’ll need to update your Tree-sitter grammars due to some upstream (breaking) changes in the TS OCaml grammar.
1 Like