borela / naomi

Sublime Text enhanced syntax highlighting for JavaScript ES6/ES7/ES2015/ES2016/ES2017+, Babel, FlowType, React JSX, Styled Components, HTML5, SCSS3, PHP 7, phpDoc, PHPUnit, MQL4. Basic: Git config files.
Other
558 stars 18 forks source link

25000 context sanity limit hit for PHP syntax #183

Open BokuNoCode opened 6 years ago

BokuNoCode commented 6 years ago

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

beznosd commented 6 years ago

Just after installation of Naomi experienced the same issue.

context-limit
borela commented 6 years ago

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

beznosd commented 6 years ago

Thank you!

chavab1 commented 6 years ago

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

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

borela commented 6 years ago

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 commented 6 years ago

OK, thanx for the clarification and your help.

brokeyourbike commented 5 years ago

Is there a way to disable only Naomi PHP syntax?

borela commented 5 years ago

@brokeyourbike

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

cibulka commented 5 years ago

@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 commented 5 years ago

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 commented 5 years ago

Still waiting for a fix

dharnarh commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

maerzhase commented 4 years ago

+1

CelestinaDragoni commented 3 years ago

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:

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

boycce commented 3 years ago

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

CelestinaDragoni commented 3 years ago

@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 commented 2 years ago

Please fix this, Team!