-
Notifications
You must be signed in to change notification settings - Fork 4
Java Changelogs Syntax Highlighting
Stefan van der Velden edited this page Mar 7, 2025
·
5 revisions
The changelogs for the Java edition of Minecraft do not include any syntax highlighting, so in order to perform our own syntax highlighting we need to use some heuristics to determine what kind of highlighting to do.
The current implemented/planned heuristics are as follows, in the order they are checked:
- Tags (
^#[a-z0-9._-]+(:[a-z0-9._-]+)?$), would highlight as a comment if naively highlighted as mcfunction, need to add any command prefix in the grammar state (e.g.t) to ensure it is highlighted as a tag - Special keywords:
true,false, highlight as mcfunction. These would normally be hit by the key case below, but are very unlikely to be used for anything other than being these keywords - Potential command name (
^[a-z]+): Would be caught by the key case below, but should be highlighted as mcfunction as there's a decent chance it is a command name - Single key (
^[a-zA-Z][a-zA-Z0-9._-]*$): The name of a JSON/(S)NBT key - Folder paths/resource locations, potentially with placeholders, would like some custom highlighting for these (currently not implemented). e.g.
data/<namespace>/wolf_sound_variant/<id>.jsonand<namespace>:<id> - Just highlight as mcfunction, works for command related stuff, SNBT, and JSON