Sublime Forum

Sublime Syntax

#1

Since I haven’t found a post or announcement explicitly describing the differences between .sublime-syntax and .tmLanguage – is the YAML file simply a conversion from XML or is there more to it? Probably worth noting in the documentation!

0 Likes

#2

was this not descriptive enough?

0 Likes

#3

Yes, I’m aware of both pages and read them before (I didn’t read every post in the thread). I’m also aware of the possibility to convert these files within Sublime Text. Yet, that doesn’t answer my question. Is this a plain conversion that could be done with any XML2YAML converter?

0 Likes

#4

sublime-syntax extends tmLanguage functionality, so you can convert from tmLanguage to sublime-syntax but not vice-versa. I’m not sure about any XML -> YAML converter, but it’s built in to ST: I’m sure in the Tools -> Developer menu when you have a tmLanguage file open is an option to convert to sublime-syntax.

2 Likes

#5

I think you meant to say .tmLanguage contains a subset of .sublime-syntax functionality. Or .sublime-syntax is a superset of .tmLanguage.

Specific features in .sublime-syntax that are not available as part of .tmLanguage:

  • The set directive
  • Pushing multiple contexts via a push or set directive. (A single push/pop is equivalent to begin/end.)
  • The clear_scopes directive
  • Variables

These are all mentioned in the docs, however we don’t specifically compare the two file formats.

There are a few things I need to clean up there, so I can probably add a high-level “differences” section.

1 Like

Re-use matches in sublime-syntax
#6

whoops, yes I did! I have edited my post to correct that, thanks! :wink:

0 Likes