Sublime Forum

Package Error - Sanity Limit - Build 4189

#1

This morning I installed Build 4189 and when I opened an ASP.net C# file I received this error:
Error loading syntax file “Packages/HTML(C#)/aspnet.sublime-syntax”: Apparent recursion within with_prototype action 25000 context sanity limit hit.

Tried rolling back to 4186 but the error is still there. The color coding is no longer there and what’s worse none of my ASP.net snippets aren’t working.

Screenshot%202024-12-23%20072910

0 Likes

#2

Recent builds added support for HTML syntax highlighted tagged template strings in JavaScript, unfortunatelly causing this issue with syntaxes which extend plain HTML by push...with_prototype.

Most syntaxes have been refactored to avoid this, but it seems some are still affected, so are

which both seem to claim support for same kind of syntax more or less.

Please be patient. I am looking forward to prepare a PR with refactored syntax based on lessons learned from all the other template engines such as Ngx,Svelte,Vue, etc.

see: https://github.com/sublimehq/sublime_text/issues/6555

1 Like

#3

Same problem with CFML. Sorry to hear a rollback does not help. Package Control is also not working for me so I am struggling to reconfigure anything useful.

0 Likes

#4

CFML is also affected, but devs have shipped a quick workaround, AFAIK.

What means Package Control not working? In case you are still on v3.4.1, yes that’s no longer working on recent MacOS/Linux builds. In such case PC4 needs to be installed/updated manually.

0 Likes

#5

Thanks for the info @deathaxe. I think it was just time for a clean install. Package Control wasn’t showing in the Preferences menu, neither was the Install Package Control. I tried installing it manually and that didn’t work. So… Uninstall and clean reinstall has sorted all that out. I tried reusing the old Project and Workspace files but then I got an error message about syntax so I have resigned myself to rebuilding those as I need them - I only have a few and they’re not complicated so it is no great drama.

Thanks again for your help.

0 Likes

#6

Hello, can you help me with my syntax?

There may be such fragments in the code with my syntax:

string = "string scope <qhtml>HTML-code <br><p> etc</p></qhtml> string scope"

Between doublequotes — string’s scope, between “qhtml”- open and close tags — HTML-code with the included highlighting of Sublime Text.

The following code of sublime-syntax worked in previous version of ST:

htmlsupport:
  - match: (?i:<qhtml>)
    scope: avs.html
    push:
      - clear_scopes: true
      - meta_scope: markup.raw avs.htmlsupport text.html
      - include: Packages/HTML/HTML.sublime-syntax
    with_prototype:
      - match: (?i:</qhtml>)
        scope: avs.html
        pop: true

This code clear sopes between tags “qhtml”, but it is does not work in new version ST. I change this code by this:

htmlsupport:
  - match: (?i:<qhtml>)
    captures:
      0: avs.html
    embed: scope:text.html.basic
    embed_scope:
      markup.raw.code-fence.html.qsp
      text.html.basic
    escape: (?i:</qhtml>)
    escape_captures:
      0: avs.html

It’s work, but between “qhtml” saves string scope and previous contexts. How I make clear the scopes/contexts between “qhtml” tags?

Sorry my bad English.

0 Likes

#7

For given use case, you don’t need with_prototype.

htmlsupport:
  - match: (?i:<qhtml>)
    scope: avs.html
    push:
      - clear_scopes: true
      - meta_scope: markup.raw avs.htmlsupport text.html
      - match: (?i:</qhtml>)
        scope: avs.html
        pop: true
      - include: Packages/HTML/HTML.sublime-syntax

If you only need basic HTML highlighting (no nestes JavaScript, CSS, …) you can also …

htmlsupport:
  - match: (?i:<qhtml>)
    scope: avs.html
    push:
      - clear_scopes: true
      - meta_scope: markup.raw avs.htmlsupport text.html
      - match: (?i:</qhtml>)
        scope: avs.html
        pop: true
      - include: Packages/HTML/HTML (Plain).sublime-syntax

I’d probably also add some punctuation scopes:

htmlsupport:
  - match: (?i)(<)(qhtml)(>)
    scope: meta.tag.html.avs
    captures:
      1: punctuation.definition.tag.begin.html.avs
      2: entity.name.tag.html.avs
      3: punctuation.definition.tag.end.html.avs
    push:
      - clear_scopes: true
      - meta_scope: markup.raw text.html.embedded.avs
      - match: (?i)(</)(qhtml)(>)
        scope: meta.tag.html.avs
        captures:
          1: punctuation.definition.tag.begin.html.avs
          2: entity.name.tag.html.avs
          3: punctuation.definition.tag.end.html.avs
        pop: true
      - include: Packages/HTML/HTML.sublime-syntax
0 Likes

#8

Thank you very much!
My understanding is clear now. (crossed out)I didn’t know that “include” allows to include other syntax(crossed out). Thanks again.

Stop: :sweat_smile: i use include other syntax. Sorry. Brain boiling. :laughing:

0 Likes