Does pydev support autocompletion on metaclasses?
Sepcifically I am working with python protocol buffer modules.
Using Ipython I am able to import a protocol buffer module and see memebers of the message metaclasses via auto completion, specifically the declared enums for a message if you are familiar with protcol buffers. Using pydev, I can not get the same auto completion to work.
Is this not supported by pydev or am I missing something.
If it's a module you can use as a forced builtin then it should be supported, but the static analyzer is not able to get it. See:
Thanks for your response. Yes it is a module and I tried following the linked instructions with no joy. I added both the test.py module and the base google package that test.py imports to the builtins and made sure they were on the python path. Below I am posting a simplified example of the module I would like to have auto completion for. If I understand how the builtins work it seems like the example below should work like it does in ipython.
t = test.Test
t. <== I would like to see "test_field" as an auto completion option here
from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import reflection
from google.protobuf import service
from google.protobuf import service_reflection
from google.protobuf import descriptor_pb2
_TEST = descriptor.Descriptor(
name='test_field', full_name='Test.field', index=0,
number=1, type=9, cpp_type=9, label=1,
message_type=None, enum_type=None, containing_type=None,
nested_types=, # TODO(robinson): Implement.
__metaclass__ = reflection.GeneratedProtocolMessageType
DESCRIPTOR = _TEST
It could be that the info wasn't refreshed (in a pydev editor, you can try to kill the shells: "Ctrl + 2 + kill" and see if that works).
If it doesn't work, can you create a bug-report with that test and also giving info on the pythonpath you have set (and where those files are)?
Allow me to resurrect this topic…
Is it possible for PyDev to support metaclass autocompletion in the case below:
field = ['myfield', 'another']
__metaclass__ = Meta
# PyDev can know that fields exists (and not issue a waring about it) and autocomplete it as a list
# It just have to look the inheritance chain for __metaclass__.
Not in the static analyzer (please open a feature request for that).