sublimehq / Packages

Syntax highlighting files shipped with Sublime Text and Sublime Merge
https://sublimetext.com
Other
2.95k stars 586 forks source link

Error loading php syntax #1665

Closed G4Zz0L1 closed 2 years ago

G4Zz0L1 commented 6 years ago

On sublime 3.1.1 build 3176

Without changing, or adding any plugin, suddenly sublime starts complaining this:

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

jfcherng commented 6 years ago

Could you provide a test case to reproduce this issue?

G4Zz0L1 commented 6 years ago

I just have to open a .php file, and this pops up

image

The strange thing it's that it always have worked, for the last 4+ years, with the same identical setup

"installed_packages":
    [
        "1337 Color Scheme",
        "Alignment",
        "All Autocomplete",
        "AndyPHP",
        "ApacheConf",
        "ApplySyntax",
        "AutoFileName",
        "BetterFindBuffer",
        "Bootstrap 3 Snippets",
        "BracketHighlighter",
        "CodeFormatter",
        "Color Highlighter",
        "Color Scheme - Rainbow",
        "ColorPicker",
        "Colorsublime",
        "CSS3",
        "CSScomb",
        "Dayle Rees Color Schemes",
        "Devastate",
        "DocBlockr",
        "DocPHPManualer",
        "EditorConfig",
        "Emmet",
        "ExpandRegion",
        "FileDiffs",
        "Git",
        "GitGutter",
        "GotoDocumentation",
        "HTML Extended",
        "HTML Head Snippets",
        "HTML Snippets",
        "HTML5",
        "HTMLAttributes",
        "HTMLBeautify",
        "HTMLEntity Snippets",
        "ImprovedSQL",
        "Incrementor",
        "INI",
        "JavaScriptNext - ES6 Syntax",
        "jQuery",
        "jQuery Mobile 14 Snippets",
        "jQuery Mobile Snippets",
        "jQuery Snippets pack",
        "Local History",
        "Material Theme",
        "Minify",
        "MySQL Snippets",
        "Neon Color Scheme",
        "Numix Theme",
        "Open-Include",
        "Package Control",
        "Package Syncing",
        "PHP Companion",
        "PHP Completions Kit",
        "PHP-Twig",
        "Phpcs",
        "phpfmt",
        "PHPIntel",
        "PHPSnippets",
        "Predawn",
        "Predawn Monokai",
        "Rainglow",
        "Restart",
        "SFTP",
        "SideBarEnhancements",
        "Smarty",
        "SqlBeautifier",
        "SublimeCodeIntel",
        "Sublimerge 3",
        "Sync View Scroll",
        "Tag",
        "Text Pastry",
        "Theme - Asphalt",
        "Theme - Augmented Reaction",
        "Theme - Brogrammer",
        "Theme - Cyanide",
        "Theme - Flatland",
        "Theme - Freesia",
        "Theme - Glacier",
        "Theme - itg.flat",
        "Theme - Numix",
        "Theme - Orchis",
        "Theme - Phoenix",
        "Theme - Piatto",
        "Theme - Spacegray",
        "Theme - Tech49",
        "Theme - Watson",
        "Tomorrow Color Schemes",
        "Trimmer",
        "WordCount"
    ]
keith-hall commented 6 years ago

Most likely one of those packages has recently been updated and is now causing this issue in your environment. It doesn't happen in a clean state.

G4Zz0L1 commented 6 years ago

I'll try to revert to clean asap and report

petrowsky commented 6 years ago

Just reporting in that I started getting the same today.

screen shot 2018-07-17 at 5 51 25 pm

screen shot 2018-07-17 at 5 49 45 pm

I've disabled "SublimeLinter", "SublimeLinter-php", "SublimeLinter-phpcs", "SublimeLinter-phplint" and other php related packages. So far, getting no luck.

G4Zz0L1 commented 6 years ago

I haven't had a chance to reset sublime on my workstation, I'll check as soon as I get to home, if it does the same.

mybooam commented 6 years ago

remove CSS3 work for me

but php syntax not load

petrowsky commented 6 years ago

Yep, I think you found the culprit.

I just disabled that and re-enabled all the supporting php mods, such as the linter, and the error is gone. For me the syntax coloring is back for PHP and the linter is working. Of course embedded scopes such as CSS are not coloring.

I don't know enough about the environment to know what is causing the error, but here's the top part of my console output after disabling CSS3. Obviously, the Error loading scope:source.css: Unable to find syntax file for scope source.css is going to happen because I don't have anything loading for the CSS scope.

startup, version: 3176 osx x64 channel: stable
executable: /Applications/Sublime Text.app/Contents/MacOS/Sublime Text
working dir: /
packages path: /Users/username/Library/Application Support/Sublime Text 3/Packages
state path: /Users/username/Library/Application Support/Sublime Text 3/Local
zip path: /Applications/Sublime Text.app/Contents/MacOS/Packages
zip path: /Users/username/Library/Application Support/Sublime Text 3/Installed Packages
ignored_packages: ["CSS", "CSS3", "Emmet", "Emmet Css Snippets", "LiveStyle", "Markdown", "PlainTasks", "Six", "SublimeLinter-jshint", "Vintage", "Vintageous"]
Errors parsing theme:
icon_folder_loading is missing layer0.opacity, setting to 1.0 for backwards compatibility
pre session restore time: 0.942442
using gpu buffer for window
using gpu buffer for window
using gpu buffer for window
using gpu buffer for window
startup time: 1.21789
Error loading scope:source.css: Unable to find syntax file for scope source.css in Packages/PHP/PHP.sublime-syntax
scan: symlink to /Users/username/Sites/drupal/docroot/sites/www.filemakermagazine.com has been seen before, superseding (using inode) previous path: /Users/username/Sites/drupal/docroot/sites/default inode: 12711147
Packages/PHP/PHP.sublime-syntax: embed scope:source.css#rule-list-body could not be found
scan: /Users/username/Sites/drupal/docroot/sites/www.filemakermagazine.com/private has been seen before, skipping (using inode) previous path: /Users/username/Sites/drupal/docroot/files-mag-private inode: 13142668
scan: /Users/username/Sites/drupal/docroot/sites/www.filemakermagazine.com/files has been seen before, skipping (using inode) previous path: /Users/username/Sites/drupal/docroot/files-mag-public inode: 13139542
scan: /Users/username/Sites/drupal/docroot/sites/www.filemakermagazine.com/modules/o_contrib_seven has been seen before, skipping (using inode) previous path: /Users/username/Sites/drupal/docroot/o_contrib_seven inode: 13141216
environment variables loaded using: /bin/zsh -l
petrowsky commented 6 years ago

And... after disabling CSS3 you'll then get this for any .css file. :)

screen shot 2018-07-18 at 12 08 55 pm
G4Zz0L1 commented 6 years ago

So, we have to move the culprit to css3 plugin?

Edit: it seems that the problem isn't only for php https://github.com/y0ssar1an/CSS3/issues/103 https://github.com/y0ssar1an/CSS3/issues/78

petrowsky commented 6 years ago

Yeah, I can confirm that reverting back on the CSS3 does not work. I uninstalled CSS3 via Package Control and pulled the repo directly into Packages then checked out previous tags. Going back 2.1.13 and trying everything up to 2.1.17 didn't fix. Don't know what is causing the issue.

G4Zz0L1 commented 6 years ago

I've opened an issue on that repo, let's see what they can do. I think we can close this as it's not related to this package.

FichteFoll commented 6 years ago

Make sure to enable the default css package shipped with ST after removing or disabling css3 because it asks/requires you to ignore it when installed.

petrowsky commented 6 years ago

I did notice this oddball highlight in a .css file. The last paren and semi colon?

screen shot 2018-07-18 at 12 43 43 pm
petrowsky commented 6 years ago

Just throwing out a guess here, but looking at the commit history would this one be a potential cause?

https://github.com/sublimehq/Packages/pull/1562 More precise php-end-tag scoping 9f14041368019396f4993eedabf99aaca9efe0cc

I'm not in Sublime on a daily basis so I don't have an exact start date/time for when the issue started for me. But maybe this introduced the conflict with CSS3.

jbrooksuk commented 6 years ago

I'm getting this with Markdown now.

image

image

seanCodes commented 6 years ago

Disabling the CSS3 package was the solution for me.

G4Zz0L1 commented 6 years ago

It seems fixed from the CSS3 part, with the https://github.com/y0ssar1an/CSS3/pull/108, I think we can close this

DavidPr0 commented 6 years ago

Personal just to reinforce, here was also with this same problem and I decided to remove this same package "CSS3".

jameswilson commented 5 years ago

In my case, the https://github.com/borela/naomi package was causing this issue and there were two ways to fix it:

The bug issue is here: https://github.com/borela/naomi/issues/183

thomashermant commented 5 years ago

I don't have the CSS3 package installed and I got this error on Sublime Merge here ...

RrNn commented 4 years ago

@thomashermant , not sure why, but I remove the package Naomi and PHP code was highlighted properly. I was having the issue too and I don't have the CSS3 package installed. If you probably have Naomi installed too, you can remove it and restart Sublime.

jfcherng commented 4 years ago

Not sure why people prefer that BIG syntax bundle. But if you are using ST 4, the built-in PHP syntax should've caught up all PHP 8 syntax. JSX/TS syntax is now built-in (I am not much a frontend guy but I assumed the JSCustom plugin should have provide good syntax for frontend JS/TX related things). And CSS is always good I assume...


Update: Well, PHP devs decide to change the @@ annotation syntax to another one (either #[] or @[]). Now voting.