Sublime Forum

Help with ApacheConf.tmLanguage package

#1

I installed the ApacheConf.tmLanguage, but whenever I open a config file (like .htaccess), I get the following error message:

Error loading syntax file “Packages/Apache/Apache.tmLanguage”: Error parsing plist xml: Failed to open file In file “Packages/Apache/Apache.tmLanguage”

I installed it via the Package Control.
It’s the only plugin I’ve had problems with.
Any help would be appreciated.
Thanks!

0 Likes

#2

I also installed DetectSyntax…
Come to think of it, the error message started appearing after I installed DetectSyntax…

0 Likes

#3

Two possibilities:

  1. There was some sort of bug that caused the file to not be extracted properly so the file is empty.
  2. Sublime saw a file modification event and reloaded the file before it was fully extracted. I believe I’ve seen this on Windows before.

I would start by restarting Sublime. If that doesn’t work, remove and install the package again.

0 Likes

#4

[quote=“wbond”]Two possibilities:

  1. There was some sort of bug that caused the file to not be extracted properly so the file is empty.
  2. Sublime saw a file modification event and reloaded the file before it was fully extracted. I believe I’ve seen this on Windows before.

I would start by restarting Sublime. If that doesn’t work, remove and install the package again.[/quote]

I tried restarting it several times. I uninstalled and reinstalled the package several times too.
I’m on Mac OS X, by the way…
I’m beginning to think the error is in the fact that .htaccess file differ from others in their naming convention. Maybe Sublime Text doesn’t recognize the extension or something.
If I do View > Syntax > ApacheConf while i’m in the .htaccess, then the syntax coloring and everything applies. But if I save it goes away. That and the error message popping out every time I open the file are kind of annoying…
But it’s not like I’ll be modifying those files so often, so I guess I can live without it.
Thanks anyway!

0 Likes

#5

I removed the DetectSyntax package, and ApacheConf stopped complaining, so I think the issue lies with a conflict between the two.

0 Likes

#6

ApacheConf is located in
“Packages/ApacheConf.tmLanguage/ApacheConf.tmLanguage”
instead of
“Packages/Apache/Apache.tmLanguage”

Detect syntax is not checking if the tmLanguage exists before trying to apply the new syntax.

0 Likes

#7

Thanks, tito, for opening the pull request so I’d know about this. You’re right, I wasn’t checking to make sure the file existed before trying to set it. I just pushed a fix to GitHub, so PackageControl should pick it up soon. Now I do two things:

  1. I check to make sure the file exists before trying to set it,
  2. I print a message to the console for either success or failure, in both cases supplying you with the full path to the syntax file so you’ll know what it’s trying to use

In the case where the syntax is not going to change, nothing will get printed to the console.

Sorry for the bug!

1 Like