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: 1204
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: 1204
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: 5
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: 5
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: 5
Joined: Wed Feb 23, 2011 7:38 pm

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

Postby d11wtq on Wed Aug 03, 2011 1:40 pm

Dumb question, but what exactly does this plugin do? My understanding of CTags is that it maintains and index of the symbols in your source code. So I was thinking it must allow for smarter tab completion, or something of that nature.

I've installed it on OS X (just git cloned it to my Application Support's "Packages" directory), along with installing Exuberant CTags, but I don't really see anything of interest when doing tab completion (of Ruby source code), nor anything in the application menus.

It seems like most people in this thread are already CTags users from other environments, but for the ignorant newbies, could you explain what this actually does (and doesn't do) and why we'd install it? Thanks :)
d11wtq
 
Posts: 6
Joined: Sun Jul 31, 2011 11:51 am

Next

Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 9 guests