[RFC] Sublime Syntax Main Key Sort Order
The number of main keys in the sublime-syntax file format increases. While it seems common practise to have variables context before contexts the header keys are sorted alphabetically only.
I'd propose to group the name, scope and version keys as they describe the the syntax itself.
The file_extensions and first_line_match should follow and be separated by an empty line,
Here's an example of how it could look like:
%YAML 1.2
---
# https://www.sublimetext.com/docs/syntax.html
# https://www.mysyntax.com/specs/index.html
name: MySyntax
scope: source.mysyntax
version: 2
hidden: false
extends:
- souse.basesyntax
- souse.basesyntax2
file_extensions:
- main_ext
- ext2
hidden_file_extensions:
- any
- thing
first_line_match: |-
(?x:
^\#! .* \b(mysyntax)\b | # shebang
^/[/*] \s* -\*- .*? \bmysyntax\b \s* -\*-(?: \s* [/*]/)? # editorconfig
)
variables:
var1: ...
contexts:
main:
...
As there has been no oppositions to this, I'd personally say that this is now the standard and perhaps should be written in our RFC repository https://github.com/SublimeText/ScopeNamingGuidelines :)
As there has been no oppositions to this, I'd personally say that this is now the standard and perhaps should be written in our RFC repository https://github.com/SublimeText/ScopeNamingGuidelines :)
In addition, it would be good to update the examples given in https://www.sublimetext.com/docs/syntax.html