ameyp / CscopeSublime

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

CscopeSublime not working in ST2 #51

Closed berteauxjb closed 8 years ago

berteauxjb commented 8 years ago

Hi!

I just installed CScope on Mac OSX 10.10 and tried to use this plugin in ST2, but it's not working in the current state. When running any commands (Cmd + \ and enter, Cmd + L/Cmd + S, ...), the console is outputting

Traceback (most recent call last): File "./sublime_plugin.py", line 356, in run_ File "./cscope.py", line 424, in run File "./cscope.py", line 57, in update_location AttributeError: 'Window' object has no attribute 'project_data'

From what I gathered from a quick Google search, project_data is only available in ST3. I could fix the issue by adding a line that checks if project_data in an attribute of window() on line 57 of cscope.py:

if hasattr(self.view.window(), 'project_data'): project_info = self.view.window().project_data()

I didn't try on ST3, so I don't know how it behaves there. I would assume that it sill works though!

Cheers!

vanrijn commented 8 years ago

Awesome, thanks very much @berteauxjb!!! I will try to look at this more tonight and make sure it works on ST3. Thank you for the help!! =:)

MUCb commented 8 years ago

Hello,

I have the same issue with ST2 (OS:Debian 8)

Traceback (most recent call last): File "./sublimeplugin.py", line 356, in run File "./cscope.py", line 423, in run File "./cscope.py", line 57, in update_location AttributeError: 'Window' object has no attribute 'project_data'

royger commented 8 years ago

Same here, Cscope + ST2 doesn't work anymore.

vanrijn commented 8 years ago

Okay, I think this should be fixed now guys. Can you please let package manager update this plugin and let me know what happens now? @berteauxjb's fix should prevent CscopeSublime from crashing in ST2, but I don't know that it will be able to find the cscope database file programmatically? Thanks!! =:)

royger commented 8 years ago

The issue seems to be fixed now, and the plugin is working as expected. Thanks!

vanrijn commented 8 years ago

Awesome, thanks guys!!