Sublime Forum

"Error loading syntax file" each time after opening ST2

#1

Hi,

Now I am getting Error loading syntax file "Packages/CoffeeScript/Syntaxes/CoffeeScript.tmLanguage": Error parsing plist xml: Failed to open file In file "Packages/CoffeeScript/Syntaxes/CoffeeScript.tmLanguage" each time when I open my SB2. I use Mac version, build 2217.
Nothing changes if I disable/remove CoffeeScript package.

Maybe this behavior appeared after the last update.

0 Likes

#2

I have the same problem. Really bummed. =(

0 Likes

#3

Here’s what I did to fix it. It’s a big pain, but I wanted CoffeeScript highlighting back bad enough. Move your Sublime Text 2 Preferences folder: ~/Library/Application Support/Sublime Text2 to another location. Delete and redownload a fresh ST2. Open it up. The old directory will be recreated. Restore your license file from your old Sublime Text 2 preferences folder. Reinstall Package Control and then install CoffeeScript.

Did that help you?

0 Likes

#4

Same issue here after upgrading. Managed to fix it without getting too drastic and deleting all my preferences etc. Here’s what worked for me:

  1. Close any open tabs/windows in ST2
  2. Delete ~/Application Support/Sublime Text 2/Packages/CoffeeScript
  3. Delete any folders in ~/Application Support/Sublime Text 2/Backup/ which contain the CoffeeScript plugin
  4. Remove CoffeeScript via Package Manager
  5. Quit and re-open ST2 (hopefully by now the errors have stopped)
  6. Re-install CoffeeScript via Package Manager
  7. Quit and re-open ST2

I suspect not all of these steps are strictly necessary, but shouldn’t hurt. I also found that simply moving folders (including into the Trash) didn’t seem to help, and that I had to actually empty the trash to get it to “stick”, but I also have a suspicion that it might have been because I didn’t figure out step 1 until later in the game.

Anyway, I’m happily Coffee-ing again, hope this helps someone.

0 Likes

#5

I just did:

  1. Remove CoffeeScript via Package Control
  2. Re-install CoffeeScript via Package Control

and that fixed it for me.

0 Likes

#6

I don’t understand how simply removing and reinstalling the package fixes this but if it works then great.

0 Likes

#7

danja’s steps 1-7 worked for me, thank you. Deleting and re-installing alone didn’t work. Maybe it would have worked if I hadn’t had CS files open at the time?

0 Likes

#8

I had the same problem just now.

  1. Close out all tabs in sublime text (probably would work if you only closed out the Cofeescript tabs)
  2. Remove the Coffeescript plugin with Package Control
  3. Close ST2 and Re-Open
  4. Re-install the Coffeescript plugin with Package Control.
  5. Open a coffeescript file. If the file’s language isn’t “colored” as it should be, go to View > Syntax and set your language to Coffeescript.

Worked for me :smile:

0 Likes

#9

The CoffeeScript package changed and the path to the syntax file changed. All you should need to do is close any open .coffee files and restart Sublime.

1 Like

#10

I also ended having to delete
~/Library/Application\ Support\Sublime\ Text\ 2/Settings/Session.sublime_session
at step 4. in danja’s recipe. This nukes all your local preferences and recent file lists as well. I’m sure you could find the relevant part of the file if you wanted to be less drastic about it, but I was running out of patience

0 Likes

#11
  1. Preferences -> Browse Packages
  2. create a folder named “Syntaxes” in CoffeeScript folder
  3. copy CoffeeScript.tmLanguage file to Syntaxes folder
0 Likes

#12

In Sublime Text 3 I fixed it by deleting ~/Library/Application Support/Sublime Text 3/Local/Session.sublime_session

2 Likes

#13

Thanks, deleting ~/.config/sublime-text-3/Local/Session.sublime_session (on Ubuntu) solved the problem for me.

0 Likes

#14

thank you, but i do not know why this issue is acting still now, 10 years …

0 Likes

#15

There are many sets of potential fixes listed above, but the simplest and most effective is this one:

That is, part of the information that Sublime stores about open files when it quits (or when you close a project) is the syntax definition that was in use for any open files so that when state is restored on a load it can put it back.

If the syntax file has been renamed, moved or deleted it can’t restore the syntax properly because it’s trying to load a file that’s not present. In such a case it displays the message to tell you about it. What you need to do is get Sublime to either associate the correct syntax with the file (if it has moved or changed) or tell it to use the plain text one (if it has been removed).

Various ways to do that include removing the entire session (which wipes out your entire saved session for the entire application), machinations that involve changing packages from outside of Sublime in an attempt to put the correct file back or just closing and reopening the offending file so that Sublime tries to find the appropriate syntax (falling back to plain text if it is not found).

0 Likes