Sublime Forum

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

#1

Hi,

I just updated to 3113 and got this error message (also for some other syntax files):

Error loading syntax file “Packages/Markdown/Markdown.sublime-syntax”: Apparent recursion within a with_prototype action: 25000 context sanity limit hit

Can someone explain what is going on?

Thanks!

3 Likes

#2

I’m having the exact same issue. My guess is that the limit they set up is breaking syntax highlighting rules in several community-made packages. I’m getting the error in several .tmLanguage files as well as ones defined by the newer YAML .sublime-syntax formatting.

Salesforce (MavensMate) ones I’m getting:

Error loading syntax file “Packages/MavensMate/sublime/lang/Visualforce.tmLanguage”: Apparent recursion within a with_prototype action: 25000 context sanity limit hit

Error loading syntax file “Packages/MavensMate/sublime/lang/Apex.tmLanguage”: Apparent recursion within a with_prototype action: 25000 context sanity limit hit

And I’m even getting some in the Java package:

Error loading syntax file “Packages/Java/Java.sublime-syntax”: Apparent recursion within a with_prototype action: 25000 context sanity limit hit

Looks to be a pretty big issue. My guess is that there’s some pre-loading check over the grammar defined in these files that’s tripping an alarm bell because it’s recursing too deep, so if the ST3 devs could loosen the bounds of what’s considered “apparent recursion” that would probably keep some of these errors from happening.

0 Likes

#3

Can you share some sample documents - ideally one for each affected syntax - in which you receive this error please?

0 Likes

#4

This error is non-document specific; it happens whenever I attempt to load any Salesforce code (using one of the Syntax highlighting files defined by MavensMate) or when I attempt to load any Java code (using the Java package).

I can’t seem to find the actual Java.sublime-syntax file (just a cache), but if you want the .tmLanguage files for the Salesforce plugin I can shoot those your way.

0 Likes

#5

The reason why I ask for an example document is because, although it may appear to affect every document, I can’t reproduce it with a hello world Java code for example:

public class HelloWorld {
    public static void main(String[] args) {
        // Prints "Hello, World" to the terminal window.
        System.out.println("Hello, World");
    }
}

so I am wondering if some specific constructs are used that are causing it :wink:

someone has logged an issue at the MavensMate package: https://github.com/joeferraro/MavensMate-SublimeText/issues/784

0 Likes

#6

and I also couldn’t reproduce with any of the Markdown files I opened

0 Likes

#7

plus all the Java and Markdown syntax tests are passing on this build, which is why I want to see some example code that has the problem, which can help to debug and fix it, and then it can be added to the syntax tests to ensure the problem doesn’t re-occur in future.

(the MavensMate package doesn’t seem to have bothered with tests as far as I can tell)

0 Likes

#8

The problem affects all files for me. Below is a markdown example taken from the markdown documentation. Here are some additional information (probably not very helpful though).

  • The message appears once for each syntax (as a popup and in the console)
  • For the example below, I opened a new file (cmd+n), copy & pasted the text below, and then changed the syntax to markdown
  • The only relevant change I made was upgrade from 3112 to 3113. The message started to appear after restarting from the update.
A First Level Header
====================

A Second Level Header
---------------------

Now is the time for all good men to come to
the aid of their country. This is just a
regular paragraph.

The quick brown fox jumped over the lazy
dog's back.

### Header 3

> This is a blockquote.
> 
> This is the second paragraph in the blockquote.
>
> ## This is an H2 in a blockquote
0 Likes

#9

very odd - that same markdown snippet works alright for me.

I wonder, with any file open, if you go to the Tools menu -> Build System -> Syntax Tests and then Tools -> Build With -> All Syntaxes, what is the result?

Maybe it is worth trying with a (temporary) fresh state - no plugins etc. to see if it makes a difference?
What platform are you on btw? I have only tested on Windows 7x64 so far

0 Likes

#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