-
Notifications
You must be signed in to change notification settings - Fork 144
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
Hangs forever on simple YAML file when re-building SyntaxSet #219
Comments
Apparently, it loops endlessly here: Lines 200 to 208 in 8238d80
with this state:
The second number in |
Commenting out this line: syntect/src/parsing/syntax_set.rs Line 436 in 8238d80
seems to fix it, so maybe it's a problem with how prototypes are handled on syntax sets that get turned into builders and back again? Interestingly, the YAML syntax definition's comment context is the last one that gets loaded (due to it being the last context in the YAML.sublime-syntax file), in case that makes any difference.
|
Actually, more precisely, the problem seems to be that the YAML syntax includes the |
I tried adding: Pattern::Include(ContextReference::Direct(ref s)) => {
Self::recursively_mark_no_prototype(syntax, s.index(), contexts, no_prototype);
} at syntect/src/parsing/syntax_set.rs Line 492 in 8238d80
|
Thanks for investigating! Sounds like my bad, I'll have a look tomorrow. |
After a SyntaxSet is built once, all the references are replaced by direct references (via index). When it's converted back to a builder and then built again, the code that marks prototypes needs to handle those references too, otherwise some contexts include the prototype when they should not. Fixes #219.
Raised a PR with a fix: #221 |
@keith-hall: I think all your fix was missing was doing the same thing for references in |
heh I was so close, thanks for taking over the investigation and fixing the problem @robinst - your test coverage is awesome, I could think of no suggestions for improvement ;) |
How to reproduce?
From the
syntect
root folder, perform these steps:syncat
on this file. Everything works as expected:syncat
again with--extra-sntaxes
set to the empty folderAdditional remarks
The text was updated successfully, but these errors were encountered: