Sublime Forum

Error loading syntax file "Packages/PHP-Twig/Syntaxes/HTML

#1

Hi,

I’m getting this error on each ST4 start. I have uninstalled the package and added it to ignored, but it still shows ?

Error loading syntax file "Packages/PHP-Twig/Syntaxes/HTML
(Twig).tmLanguage": Unable to stat
Packages/PHP-Twig/Syntaxes/HTML (Twig).tmLanguage

Help please ?

0 Likes

#2

This happens because a file that’s open has that syntax set, so ever time you launch ST it tries to find that syntax and fails. Closing and reopening that file, or simply changing the syntax will fix that.

1 Like

#3

Ok thanks!!
Is there a way to locate that file? I have hundreds open…
Or how can I delete the reference to that syntax ?

0 Likes

#4

Run the following script from ST’s console to assign “Plain Text” to all views currently using “HTML (Twig)”.

for v in filter(lambda v: v.syntax().name == "HTML (Twig)", window.views()): v.assign_syntax("Packages/Text/Plain text.tmLanguage")
1 Like

#5

Thanks deathaxe!

I have just searched / replaced
"syntax": "Packages/PHP-Twig/Syntaxes/HTML (Twig).tmLanguage",
to
"syntax": "Packages/PHP/PHP.sublime-syntax",

in AppData\Roaming\Sublime Text\Local\Session.sublime_session

Error is gone !
Much thanks

0 Likes