Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 208466 - dev-util/ctags broken python support
Summary: dev-util/ctags broken python support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Vim Maintainers
URL:
Whiteboard:
Keywords:
: 232787 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-02-01 18:03 UTC by Paweł Hajdan, Jr. (RETIRED)
Modified: 2009-06-10 11:49 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
python.c.patch (python.c.patch,315 bytes, patch)
2008-02-01 18:03 UTC, Paweł Hajdan, Jr. (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2008-02-01 18:03:31 UTC
Python parser in ctags is slightly broken (see http://sourceforge.net/tracker/index.php?func=detail&aid=1856363&group_id=6556&atid=106556 - variables starting with def or classmethod decorators are matched as functions/classes, which is annoying).

There is a patch in ctags svn: http://ctags.svn.sourceforge.net/viewvc/ctags/trunk/python.c?r1=629&r2=632&view=patch

But it may not apply cleanly to the current stable version of ctgas, so I made my own and verified that it works.

Please consider patching current ctags in the tree, because upstream has very long release cycle.
Comment 1 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2008-02-01 18:03:57 UTC
Created attachment 142422 [details, diff]
python.c.patch
Comment 2 Ali Polatel (RETIRED) gentoo-dev 2008-03-26 18:44:28 UTC
ctags-5.7-r1 fixes this, thanks for reporting.
Comment 3 Michal Terepeta 2008-04-13 14:20:18 UTC
(In reply to comment #2)
> ctags-5.7-r1 fixes this, thanks for reporting.
> 

Unfortunately the patch in the portage is incorrect - it misses the spaces after def and class, i.e. instead of "def" and "class" the comparisons should be made to "def " and "class ". The effect is that ctags currently cannot recognize functions and classes in python.
Simply adding those spaces should solve it. Thanks.
Comment 4 Harald van Dijk (RETIRED) gentoo-dev 2008-07-23 21:45:58 UTC
*** Bug 232787 has been marked as a duplicate of this bug. ***
Comment 5 Harald van Dijk (RETIRED) gentoo-dev 2008-07-23 21:46:55 UTC
Re-opening wrt comment #3 and bug #232787...
Comment 6 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2008-08-01 15:12:01 UTC
I tested both the version in portage and the version with my original patch. I could confirm that my patch works, and the one in portage doesn't. Please use the *original* patch, and it should be fine.
Comment 7 Tomáš Chvátal (RETIRED) gentoo-dev 2009-06-10 11:49:51 UTC
You are right, the patch in main tree is broken.
I took the liberty to fix it, vim guys had half year themselves to do so.

Enjoy