Home Download Buy Blog Forum Support

DetectSyntax

Re: DetectSyntax

Postby sbloom on Tue Jan 31, 2012 3:34 pm

I have an issue with this plugin. Not working for me on (I am on Windows 7 x64)
When I run Sublime I receive this error:

Error loading syntac file "Packages\PHP\PHP.tmLanguage":
Error parsing plist xml: Failed to open file in file "Packages\PHP\PHP.tmLanguage"

Any ideas what wrong?
sbloom
 
Posts: 5
Joined: Tue Jan 31, 2012 3:30 pm

Re: DetectSyntax

Postby phillip.koebbe on Wed Feb 01, 2012 7:49 am

sbloom wrote:I have an issue with this plugin. Not working for me on (I am on Windows 7 x64)
When I run Sublime I receive this error:

Error loading syntac file "Packages\PHP\PHP.tmLanguage":
Error parsing plist xml: Failed to open file in file "Packages\PHP\PHP.tmLanguage"

Any ideas what wrong?


Hi sbloom,

Sorry it's not working correctly for you. I don't have access to windows 7, but I *think* I know what's going on. In the default settings file where the syntax rules are defined, I use a forward slash to separate path from name, and I'm thinking that Windows doesn't like that. So I made a small change to normalize the string before doing some more work on it, and I'm hopeful it will work for you. I pushed the change to GitHub, so the next time Package Control updates, you should get the fix. If it still doesn't work, please let me know. If nothing else, I'll install ST2 on XP and see what happens.
-- Phillip

Code: Select all
while self.living? do
    mistake = Mistake.new
    self.learn_from!(mistake) unless mistake.fatal?
end
phillip.koebbe
 
Posts: 208
Joined: Tue Dec 20, 2011 4:58 pm

Re: DetectSyntax

Postby sbloom on Wed Feb 01, 2012 2:25 pm

phillip.koebbe wrote:Hi sbloom,

Sorry it's not working correctly for you. I don't have access to windows 7, but I *think* I know what's going on. In the default settings file where the syntax rules are defined, I use a forward slash to separate path from name, and I'm thinking that Windows doesn't like that. So I made a small change to normalize the string before doing some more work on it, and I'm hopeful it will work for you. I pushed the change to GitHub, so the next time Package Control updates, you should get the fix. If it still doesn't work, please let me know. If nothing else, I'll install ST2 on XP and see what happens.


Hi,
Thanks for trying to fix this. I think your plugin is awesome. Only if I had a chance to try it heh :)
Unfortunately latest update still not working to me, I get same error.

Update: the odd thing about it, that I can't get rid of that error now, even after disabling/deleting DetectSyntax. Really weird.
Last edited by sbloom on Wed Feb 01, 2012 8:09 pm, edited 2 times in total.
sbloom
 
Posts: 5
Joined: Tue Jan 31, 2012 3:30 pm

Re: DetectSyntax

Postby phillip.koebbe on Wed Feb 01, 2012 2:28 pm

sbloom wrote:Hi,
Thanks for trying to fix this. I think you plugin is awesome. Only if I had a chance to try it heh :)
Unfortunately latest update still not working to me, I get same error.


Well, that's certainly disheartening :(

It will be tonight before I'll have a chance to take another look at it, but I'll get it fixed as soon as I can. Thanks for the encouragement!
-- Phillip

Code: Select all
while self.living? do
    mistake = Mistake.new
    self.learn_from!(mistake) unless mistake.fatal?
end
phillip.koebbe
 
Posts: 208
Joined: Tue Dec 20, 2011 4:58 pm

Re: DetectSyntax

Postby phillip.koebbe on Thu Feb 02, 2012 12:50 pm

I was able to test on Windows XP in a virtual machine. I changed the use of os.path.sep to a forward slash when building the name of the syntax file that is given to ST2. It worked as expected. I pushed the changes out so if you update the plugin (or when Package Control updates it), it should work now.

As always, please let me know if it doesn't. I'm sorry for the inconvenience.
-- Phillip

Code: Select all
while self.living? do
    mistake = Mistake.new
    self.learn_from!(mistake) unless mistake.fatal?
end
phillip.koebbe
 
Posts: 208
Joined: Tue Dec 20, 2011 4:58 pm

Re: DetectSyntax

Postby cgibby on Thu Feb 02, 2012 3:56 pm

Great plugin! Thanks Phillip!

I was having the same problems as sbloom (I'm also on Win7), but your latest update fixed all of the problems and I'm now able to automatically load extensionless Apache config files with the correct syntax. Thanks again!
cgibby
 
Posts: 5
Joined: Thu Feb 02, 2012 3:54 pm

Re: DetectSyntax

Postby sbloom on Sat Feb 04, 2012 7:42 pm

Thanks for a fix!
sbloom
 
Posts: 5
Joined: Tue Jan 31, 2012 3:30 pm

Re: DetectSyntax

Postby sheamus on Fri Jun 29, 2012 8:05 pm

I have installed the plugin, and copied over the DetectSyntax.sublime-settings into my User folder. I changed default_syntaxes to syntaxes.

But all my rails files are still being ?detected? as plain Ruby files.

Did I miss a step? Do the default rules not detect rails? Do I have to add a rule?
sheamus
 
Posts: 19
Joined: Wed May 30, 2012 12:48 am

Re: DetectSyntax

Postby phillip.koebbe on Fri Jun 29, 2012 8:17 pm

Installing the plugin should have been all you needed to do. Well, maybe restarting ST2. You only need to have a copy of DetectSyntax.sublime-settings in your User folder if you want to add your own rules. By default, DetectSyntax should identify *.rb files in a Rails directory structure and set the syntax to Ruby on Rails.

What platform are you on? What is the path to the Rails project? Is there a Rails.root/config/routes.rb (that's what DetectSyntax looks for to determine if it's a Rails project). Do you have any non-ascii characters in your path?
-- Phillip

Code: Select all
while self.living? do
    mistake = Mistake.new
    self.learn_from!(mistake) unless mistake.fatal?
end
phillip.koebbe
 
Posts: 208
Joined: Tue Dec 20, 2011 4:58 pm

Re: DetectSyntax

Postby sheamus on Fri Jun 29, 2012 9:01 pm

I am on W7.

Path to rails project should be all ascii, it doesn't even have spaces.

I do have a config/routes.rb folder. What does it look relative to? I started ST2 from start menu, then choose open recent projects. My project file lives in the root of the rails project directory.

Code: Select all
C:\Users\myname\Code\SyncCode\MyProj


I removed the settings file from my User directory, and restarted ST2. But opening a model_obj.rb file still shows Ruby syntax, as opposed to Ruby on Rails.

ps - how the heck do you get notified of replies in this forum?
sheamus
 
Posts: 19
Joined: Wed May 30, 2012 12:48 am

PreviousNext

Return to Plugin Announcements

Who is online

Users browsing this forum: Exabot [Bot] and 14 guests

cron