Sublime Forum

Releasing a reference OSS implementation for .sublime-syntax?

#1

Hi,

I’ve been monitoring an issue on the GitHub linguist project as I am interested in Github supporting the .sublime-syntax format for syntax highlighting. Recently the issue was closed with the following statement:

Closing this issue because we’ll never support Sublime grammars in GitHub until the authors of Sublime release a reference OSS implementation – which seems very unlikely to happen.

Is there any chance of that happening so that GitHub could add support for .sublime-syntax to linguist?

Here is the issue url for reference:

1 Like

#2

I would guess that that the Sublime devs are unlikely to take time off from Sublime to write a reference implementation for GitHub.

However, the .sublime-syntax format isn’t very complicated. Anyone could write an unofficial implementation (given a suitable Oniguruma implementation, anyway). Is there some reason that only an official implementation would do?

0 Likes

#3

Is there some reason that only an official implementation would do?

I don’t know the answer to that. Maybe they would be fine with an unofficial implementation.

It may have to do with ongoing support. Trying to support a 3rd party anything that is a moving target can be difficult. The linguist maintainers may want the security of knowing the creator has invested time in finalizing the syntax so it doesn’t up and change on them. If it was me that is something I would consider.

The reference implementation may not be something that is feasible but I thought it worth asking.

0 Likes

#4

You might want to check out an implementation in Rust:

It’s pretty much feature complete and syncs changes in the sublimehq/Packages regularly for its own tests.

The .sublime-syntax format may still change in the future, as it recently has with the addition of the embed action to reduce overhead for large syntax trees caused by embedding with with_prototype, although the last change before that has been quite a while ago, so it’s considerably stable. Syntect already supports it as well, though the chose to translate it to some with_prototype push.

1 Like

#5

Thanks @FichteFoll! I’ve added a link to syntect and a link to your comment to the Github issue.

2 Likes