Skip to content

[RFC] Sublime Syntax Main Key Sort Order #2430

@deathaxe

Description

@deathaxe

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:
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions