Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New syntax embedding feature in sublime-syntax files #120

Closed
keith-hall opened this issue Nov 1, 2017 · 4 comments
Closed

New syntax embedding feature in sublime-syntax files #120

keith-hall opened this issue Nov 1, 2017 · 4 comments

Comments

@keith-hall
Copy link
Collaborator

Sublime Text 3153 was just released with

a change to how syntax embedding works, which makes languages embedding lots of others more practical, and can also significantly reduce memory usage.

the changelog shows:

Syntax Highlighting: Add embed action to .sublime-syntax files, which can significantly reduce memory usage

No details or documentation updates yet, but wanted to log it here because I imagine we will want to add support for it to syntect.

@trishume
Copy link
Owner

trishume commented Nov 1, 2017

The most I can find on it is this commit: sublimehq/Packages@72bd6bd

Interesting, I wonder why it improves memory usage in Sublime. I'm not sure it'll do much with syntect's architecture other than make things more complicated.

@wbond
Copy link

wbond commented Nov 1, 2017

Interesting, I wonder why it improves memory usage in Sublime.

Rather than creating copies of regexes with with_prototype patterns added to do escapes, we match the escapes separately. We also improved memory usage related to syntaxes in a number of other places.

There is temporary info/docs available at https://forum.sublimetext.com/t/dev-build-3153/33014/8.

@keith-hall
Copy link
Collaborator Author

keith-hall commented Nov 6, 2017

The embed feature is now being used quite a lot in the syntax definitions that ship with ST. I'm thinking we could get syntect to support it by converting embed/escape to the equivalent with_prototype at sublime-syntax "YAML load" time, which should hopefully avoid making the architecture too much more complicated.

@trishume
Copy link
Owner

trishume commented Nov 7, 2017

Yah if there's a straightforward translation that would work. I'm absurdly busy with school for the next month so I won't have time to do anything for the next month, possibly longer. But if someone else wants to do this I can do code review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants