Sublime Forum

Syntax highlighting problem with 3113: "Apparent recursion within a with_prototype action: 25000 context sanity limit hit"

#10

Syntax Tests shows the error message for many more languages including HTML, Ruby, Ruby on Rails, PHP, Makefile, Java, D (some others as well). The console also shows FAILED: 3869 of 21411 assertions in 37 files failed with a long list of stuff (e.g. Packages/Ruby/syntax_test_ruby.rb:43:33: [string.quoted.other.literal.upper.ruby] does not match scope [text.plain].

I am on Mac OS X 10.11.4.

What is the best way to try the fresh state? Can I just rename the parent folder of the packages folder to save everything (App Support/Sublime Text 3 on Mac os x) and then start or reinstall ST?

Thanks!

0 Likes

#11

Which packages do you have installed? Are any of the default packages ignored? Do you get notices of scopes not being found in the console (at the beginning)?

I suspect a third-party package getting broken by upstream changes to the default packages.

0 Likes

#12

I don’t think that any of the default packages are ignored and also don’t see any problems with scopes.
Here is the content of the console right after starting ST (with a list of loaded packages): https://www.dropbox.com/s/notp859ohr0q4le/st-startup.txt?dl=0
There are three package-related error message but I don’t think there are related.

0 Likes

#13

First, try disabling Latexing. Second, do you have any override packages for Latex or Markdown where perhaps the syntax has been modified?

0 Likes

#14

Same problem when I disable Latexing. The only sublime-syntax files in the packages folder is “HTML.sublime-syntax” and a couple of “.tmLanguage” files. I removed all the LaTeX related files in the Packages folder but the problem is still the same (a “.sublime-settings” file, an unused theme, python file with completions for latex, and TeX.tmLanguage).

But I think this is more general than Latex and Markdown. I get the error message for many files including HTML, Ruby, Ruby on Rails, PHP, Makefile, Java, D (some others as well). I didn’t realize that in the beginning because the message only pops if a open a file with that syntax (or switch to a project with one of the files open).

I might just have to go through the packages individually.

0 Likes

#15

I’m on Mac 10.11.5 beta and sublime 3113 and I also have a lot of these errors

Here is a long list of failed test in console

and I also get 7 dilaog box errors like this:

0 Likes

#16

@aziz, do you have a list of installed packages? Just asking to see how they overlap with my packages.

0 Likes

#17

Here is the list:

0 Likes

#18

Okay, I found the source of the problem. I had the file HTML/HTML.sublime-syntax in my Packages folder. Removing the file solved the problem. Also for all the other languages. No idea why a single sublime-syntax creates all these problem but I think it should be addressed. Couple of reasons why I think it’s important to address this: 1) The problem clearly appeared after 3113. 2) HTML.sublime-syntax was created by converting a tmLanguage file. Maybe the original tmLanguage was broken but the conversion process shouldn’t lead to these problem. 3) There seem to be a number of people that are affected by this. @wbond?

Link to sublime-syntax file:

0 Likes

#19

Nice. I had a similar issue. I had this old HTML syntax hack to highlight Angular.js in my User directory

https://github.com/aziz/sublimeText3-Userfiles/blob/master/Syntaxes/HTML%20(Angular.js).tmLanguage

Removing it fixed most of the problems. Number of failed test dropped from 2616 to 67
and the error dialog box only shows for babel

0 Likes

#20

Well, I wasn’t that far off with my second guess, at least.

I have a feature for PackageResourceViewer on my TODO that would notify when a default package file changes to be more recent than an override file, which should have helped troubleshoot this. I have even more changes planned (that would probably hint a rename of the package to be more general-purpose resource editing and not just viewing and creating override files), but as everyone knows that’s just plans.

3 Likes

#21

Is there a fix for this besides removing the syntax highlighting packages?

0 Likes

#22

The PHP syntax includes HTML.sublime-syntax for chunks of HTML inside of a function or other block. Unfortunately you overrode the HTML syntax to include PHP, thus creating an include loop. Preventing/detecting such recursion is complicated, hence the sanity check error message.

You saw the problem manifested in other syntaxes since they include HTML, thus inheriting the include loop.

For anyone seeing lots of test failures, it means you’ve overridden a default syntax with something that can not handle the edge cases presented in the test file, or uses different scopes.

The implementation of the various syntaxes can be changed, however tweaks will need to be implemented in such a way that various tests still pass. It may be possible to remove the with_prototype in PHP.

I’m actually on vacation for a while since we just welcomed a new addition to our family. I’ll definitely be working on syntaxes again once I’m back.

4 Likes

Stable Build 3114 breaks PHP and Markdwon plugin syntax
#23

Congratulations on the new family member @wbond :slight_smile:

2 Likes

#24

Could we perhaps get an improved error message for these somehow? Most of them are related to some HTML.sublime-synax override or alternative that someone or some plugin placed in the Packages folder, but it’s kinda hard to spot which one gets included when this message is displayed since it only lists the most outer syntax file. Maybe provide the syntax files of the first n steps, preferrably also the context name?

And congratulations on your family addition.

2 Likes

#25

@FichteFoll, i’m not sure if this helps. but when i open the console I see the following error. A bit different from the above:

Error loading scope:source.coffee: Unable to find syntax file for scope source.coffee in Packages/ShellScript/Shell-Unix-Generic.sublime-syntax
error: Error loading syntax file “Packages/ShellScript/Shell-Unix-Generic.sublime-syntax”: Apparent recursion within a with_prototype action: 25000 context sanity limit hit

0 Likes

#26

is there a way to just revert back to version 3103? I’m not using dev builds, just a production pleb user here, and 3114 has broken my html syntax highlighting.

error: Error loading syntax file "Packages/HTML/HTMLx.tmLanguage": Apparent recursion within a with_prototype action: 25000 context sanity limit hit

I’m not able to figure this out. I’ve tried deleting files, tried looking for what file is calling the HTMLx file, i just want to revert back to what was working at this point.

0 Likes

#27

Yes, you can use the installer for 3103. See my post here:

1 Like

#28

Was this ever fixed?

I’m using build 3169 and am getting this on markdown files both with the default Markdown plugin and the “Markdown Extended” plugin and also with “MarkdownHightlighting” plugin. Nothing works.

EDIT: fixed the issue, details here

1 Like

Cannot load Markdown files: "Apparent recursion within a with_prototype action: 25000 context sanity limit hit"
#29

The Naomi package is known to hit the sanity limit on recent builds. Do you use it?

This sanity limit should just avoid infinite loops caused by too complex syntax definitions.

0 Likes