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

25000 context sanity limit hit for PHP syntax #183

Open
BokuNoCode opened this issue Oct 25, 2018 · 20 comments
Open

25000 context sanity limit hit for PHP syntax #183

BokuNoCode opened this issue Oct 25, 2018 · 20 comments

Comments

@BokuNoCode
Copy link

BokuNoCode commented Oct 25, 2018

error: Error loading syntax file "Packages/PHP/PHP.sublime-syntax": Apparent recursion within a with_prototype action: 25000 context sanity limit hit

@beznosd
Copy link

beznosd commented Oct 31, 2018

Just after installation of Naomi experienced the same issue.
context-limit

@borela
Copy link
Owner

borela commented Nov 1, 2018

This is being fixed and a temporary solution is described here.

@beznosd
Copy link

beznosd commented Nov 1, 2018

Thank you!

@chavab1
Copy link

chavab1 commented Nov 2, 2018

Avoid using the builtin PHP, Markdown and Latex syntaxes if possible

Are we suppose to remove the default PHP syntax temporarily??

@borela
Copy link
Owner

borela commented Nov 2, 2018

Avoid using the builtin PHP, Markdown and Latex syntaxes if possible

Are we suppose to remove the default PHP syntax temporarily??

No, you just configure files to open with the alternative syntax by default.

  1. Open the PHP file;
  2. Go to View > Syntax > Open all with the current extension as...;
  3. Select the Naomi alternative PHP syntax.

The default PHP package can still be enabled, error will only appear if you try to highlight the code using the builtin syntaxes.

@chavab1
Copy link

chavab1 commented Nov 2, 2018

OK, thanx for the clarification and your help.

@brokeyourbike
Copy link

Is there a way to disable only Naomi PHP syntax?

@borela
Copy link
Owner

borela commented Jul 8, 2019

@brokeyourbike

Rename the “naomi.php7.sublime-syntax” to “naomi.php7.sublime-syntax.disabled” located at:

  • OS X: ~/Library/Application Support/Sublime Text 3/Packages/Naomi/syntaxes/
  • Linux: ~/.config/sublime-text-3/Packages/Naomi/syntaxes/
  • Windows: %APPDATA%\Sublime Text 3\Packages\Naomi\syntaxes\

@cibulka
Copy link

cibulka commented Jul 26, 2019

@borela Unfortunately that does not help.

I renamed the file /Users/<USER>/Library/Application Support/Sublime Text 3/Packages/Naomi/syntaxes\naomi.php7.sublime-syntax to /Users/<USER>/Library/Application Support/Sublime Text 3/Packages/Naomi/syntaxes naomi.php7.sublime-syntax.disabled, restarted Sublime text and error persists: Error loading syntax file "Packages/PHP/PHP.sublime-syntax": Apparent recursion within a with_prototype action: 25000 context sanity limit hit.

What did I do wrong?

@rishisharma08
Copy link

naomi's php syntax highlighting breaks when there are escaped single quotes inside a string of single quotes.
$str = 'asd\'s \'asd';
so i was trying to revert back to native php syntax highlighter but that broke. so i ended up disabling naomi for now. i downloaded it for React but ill just have to make do without it for now.

@mflash123
Copy link

Still waiting for a fix

@dharnarh
Copy link

@borela Unfortunately that does not help.

I renamed the file /Users/<USER>/Library/Application Support/Sublime Text 3/Packages/Naomi/syntaxes\naomi.php7.sublime-syntax to /Users/<USER>/Library/Application Support/Sublime Text 3/Packages/Naomi/syntaxes naomi.php7.sublime-syntax.disabled, restarted Sublime text and error persists: Error loading syntax file "Packages/PHP/PHP.sublime-syntax": Apparent recursion within a with_prototype action: 25000 context sanity limit hit.

What did I do wrong?

Were you able to disable it yet? doesn't seem to work for me

@devnix
Copy link

devnix commented May 28, 2020

Just tried this plugin. In first place, it broke the original PHP syntax, and when I've selected the Naomi PHP syntax, it didn't highlight HTML outside the PHP tags. Loved how it displays pure PHP files though, but it's unusable for me

@CptTony
Copy link

CptTony commented Jul 6, 2020

Welp, looks like this isn't getting fixed any time soon. Gotta find another plugin for react cause Naomi is no good for php and breaks the native highlighting.

@jeremytm
Copy link

jeremytm commented Aug 9, 2020

Same as @rishisharma08, installed for react but it breaks php... Why wouldn't they fix it? Is this project abandoned?

@maerzhase
Copy link

+1

@CelestinaDragoni
Copy link

CelestinaDragoni commented Dec 29, 2020

Attached is a working plugin that supports Naomi PHP7, Sublime (Native) PHP, and React/JSX using Naomi without conflict.

FWIW, the breaking syntax highlighter was css3 which, NGL, seems useless since sublimes CSS highlighter is perfectly fine.

Just delete the original package and replace it with this one. For good measure close your sublime, delete your cache folder, reopen.

Naomi-WorkingReact-PHP.tar.gz

Alternative Solution:
Alternatively delete all syntaxes you don't want out of Naomi. What you need for just react highlighting is the following:

  • fjsx15
  • flow1
  • jsx1
  • shared

Remove any and all other sublime-syntax/directory files not related to the above in Namomi/Syntaxes.

@boycce
Copy link

boycce commented Apr 25, 2021

@KernelZechs removing seems to break React CSS (style-components)

@CelestinaDragoni
Copy link

CelestinaDragoni commented Apr 26, 2021

@KernelZechs removing seems to break React CSS (style-components)

It does, however I don't use them (and in a work capacity where I do we're migrating away from them) so the above solution works fine for me. I can see if I can try to make another patch to fix that problem, but I wish the Naomi team would actually address this ticket instead of me championing this cause.

@h0jeZvgoxFepBQ2C
Copy link

Please fix this, Team!

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