ameyp / CscopeSublime

A Cscope plugin for Sublime Text 2 and 3
89 stars 37 forks source link

Error when trying to load "Lookup Results.hidden-tmLanguage" #3

Closed bill-kolokithas closed 11 years ago

bill-kolokithas commented 11 years ago

error: Error loading syntax file "Packages/CscopeSublime/Lookup Results.hidden-tmLanguage": Error parsing plist xml: Failed to open file In file "Packages/CscopeSublime/Lookup Results.hidden-tmLanguage"

Happens when the plugin opens a tab for it's results.

vanrijn commented 11 years ago

Yeah, I'm hitting this too. I don't understand. I've run "plutil -lint" and "plutil -p" on the hidden-tmLanguage file and it looks like the file is valid XML.

vanrijn commented 11 years ago

Actually, I know what the problem is. This line in cscope.py:

    if view.settings().get('syntax') == "Packages/CscopeSublime/Lookup Results.hidden-tmLanguage":

When Package Control creates this directory, it calls it Cscope, not CscopeSublime. Creating a symlink from Cscope to CscopeSublime in Packages fixes the problem. But that's not a real solution. Look for a real solution now.

vanrijn commented 11 years ago

Er... sorry, I meant "Looking for a real solution now". My first thought was that hard-coding the package directory was a bad idea, since a user could pick a different name other than "CscopeSublime". It looks like other packages do this too, but I'll try to find a solution that doesn't do this.

vanrijn commented 11 years ago

So, it looks like maybe this is the correct behavior. =:/ Or at least, all the other packages I have installed do it exactly the same way. So maybe the bug is that Package Control puts this in a directory called "Cscope" rather than "CscopeSublime"?

vanrijn commented 11 years ago

I think there's 2 solutions to this problem:

1) Change the directory name that is used inside this plugin from "CscopeSublime" to "Cscope"

2) Change package_control_channel/repositories.json to use "CscopeSublime" as the directory for this plugin instead of "Cscope".

It looks like most Sublime Text plugins don't include "Sublime" in the directory name that is used with package_control_channel/repositories.json, so I've fixed this in CscopeSublime's code as per option 1 above. I'll issue a pull request next.

ameyp commented 11 years ago

Wow, thanks for the investigation and the solution @vanrijn !

ameyp commented 11 years ago

Fixed with @vanrijn 's pull request https://github.com/ameyp/CscopeSublime/pull/5