Home Download Buy Blog Forum Support

CTags for Sublime Text 2 (XPlatform, No Deps)

Re: CTags for Sublime Text 2 (XPlatform, No Deps)

Postby lunixbochs on Wed Jul 27, 2011 12:58 am

sublime seems to do a fairly standard python module reload.

it re-executes the code in the reloaded module *but* the globals() environment remains from the previous run(s). if you need a cleaner environment on reload, you need to do something like search through globals and delete everything not matching sublime's python builtins

also make sure to not start any threads after the first module load. you can do something like:
Code: Select all
if not 'already' in globals():
    globals()['already'] = True
    do_init_stuff()
lunixbochs
 
Posts: 91
Joined: Fri Oct 08, 2010 10:18 pm

Re: CTags for Sublime Text 2 (XPlatform, No Deps)

Postby lunixbochs on Wed Jul 27, 2011 8:29 pm

sublimator wrote:It would be great to have a smart module reloader for development of plugins. When you are editing dependency libs that a plugin imports or there's an import chain (zenplugin < zencoding.x < zencoding.y) you end up just doing `hot exit, restart` a lot.

Pretty damn quick but it'd be better if it could do a chain reload.


I'll look into this. I already have my own automatic reloading stuff from sublimelint I can use as a base.
lunixbochs
 
Posts: 91
Joined: Fri Oct 08, 2010 10:18 pm

Re: CTags for Sublime Text 2 (XPlatform, No Deps)

Postby adzenith on Thu Jul 28, 2011 1:08 am

sublimator wrote:Just noticed I pushed a dodgy settings file before ... Fixed ...

God, I'm not winning atm.

Oh, ok, good. I was hoping it wasn't just all on my end. :)
adzenith
 
Posts: 1213
Joined: Mon Oct 19, 2009 9:12 pm

Re: CTags for Sublime Text 2 (XPlatform, No Deps)

Postby adzenith on Thu Jul 28, 2011 5:21 pm

This is amazing. You, sir, are my hero.
adzenith
 
Posts: 1213
Joined: Mon Oct 19, 2009 9:12 pm

Re: CTags for Sublime Text 2 (XPlatform, No Deps)

Postby lukasbob on Fri Jul 29, 2011 8:45 am

If anyone is having trouble getting the CTags -R flag to work on OSX, you are probably using the stock CTags installation.

* Follow the instructions on http://adamyoung.net/Exuberant-Ctags-OS-X to install a good version of CTags that recognizes the -R flag. This installs CTags to /usr/local/bin.

Note: There is a broken link on that page - looks like it was an old sourceforge mirror. Here's a working link:
http://ignum.dl.sourceforge.net/project ... 5.8.tar.gz


* Make sure that Sublime Text is using the right version of CTags: Ensure that ~/.MacOSX/environment.plist has /usr/local/bin in the PATH string before /usr/bin (the standard location for CTags). Here's a sample environment.plist that should work:

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin</string>
</dict>
</plist>


* If /usr/local/bin wasn't in your PATH already, you have to log out and log back in for the environment variables to be read in again.

Hope this saves someone some time!
Last edited by lukasbob on Fri Jul 29, 2011 1:33 pm, edited 1 time in total.
lukasbob
 
Posts: 6
Joined: Wed Feb 23, 2011 7:38 pm

Re: CTags for Sublime Text 2 (XPlatform, No Deps)

Postby lukasbob on Fri Jul 29, 2011 9:07 am

I'm getting a unicode error when displaying the contents of the tags file in the quick panel. I'm not sure whether it should be the responsibility of the plugin to validate input, or whether the quick panel should just handle it.

Code: Select all
Traceback (most recent call last):
  File "./sublime_plugin.py", line 249, in run_
  File "./ctagsplugin.py", line 401, in command
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 118: ordinal not in range(128)


I can send through a tags file if that helps. For now, here's the culprit string:

Code: Select all
'and as such DL contains a lot of syntactic hacks<sup><a class="footref" name="fnr.1" href="#fn.1">1</a></sup> such as \xe2\x80\x9cfoo == bar ?  a'


Thanks!
lukasbob
 
Posts: 6
Joined: Wed Feb 23, 2011 7:38 pm

Re: CTags for Sublime Text 2 (XPlatform, No Deps)

Postby lukasbob on Fri Jul 29, 2011 1:42 pm

I knew there was something about those instructions... I just noticed the link to the CTags tarball on that page is broken. I have edited my reply above accordingly. I don't know if you want to amend the README as well.

Thanks for some marvelous work, btw. This, together with SublimeLint, ZenCoding and SublimeCodeIntel... This editor is really starting to show some teeth.
lukasbob
 
Posts: 6
Joined: Wed Feb 23, 2011 7:38 pm

Previous

Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 4 guests