No omnicompletion for python class members in vim? -



No omnicompletion for python class members in vim? -

i want create tags (ctags 5.8) file classes in python.for functions, , class members defined outside class definition omnicompletion works ok. if define info fellow member in constructor ( self.x=2 ) cannot see ctags completion ?

class a(object): def __init__(self): self.x = "whatever" # x not seen in ctags/omnicompletion!!!

am doing sth wrong ? why there no omnicompletion (ctags file looks ok) ?

if understood problem right, can add together attributes in class definition:

class a(object): x = none def __init__(self): self.x = whatever

this way reading code sees, attributes (you calling them "class members") class has.

update: checked

$ ctags --version exuberant ctags 5.9~svn20110310, copyright (c) 1996-2009 darren hiebert compiled: mar 18 2011, 10:38:14

the resulting tags file looks this:

!_tag_file_format 2 /extended format; --format=1 not append ;" lines/ !_tag_file_sorted 1 /0=unsorted, 1=sorted, 2=foldcase/ !_tag_program_author darren hiebert /dhiebert@users.sourceforge.net/ !_tag_program_name exuberant ctags // !_tag_program_url http://ctags.sourceforge.net /official site/ !_tag_program_version 5.9~svn20110310 // aaa.py /^class a(object):$/;" c __init__ aaa.py /^ def __init__(self, x):$/;" m class:a x aaa.py /^ x = none$/;" v class:a

as can seen, x attribute has own record.

also checked emacs creating emacs-compatible tags file first:

ctags -e aaa.py # aaa.py - file code snippet above

(this created tags file)

inside emacs:

m-. x (enter) ~/tags (enter)

...and voila! cursor @ x = none line.

also, original snippet doesn't work. advice initialize attribute in class namespace valid.

python vim ctags omnicomplete

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -