Implementing dynamic object code completion (Python)

Answered

I am building a project where I'll be defining class attributes in a JSON/Yaml like file. I'd like to update the code completion of the object to include these objects.

I'd also like to present "generated" functions for these objects. So if I had "object1" and "object2" I would be presented with new methods like "update_object1/2" "delete_object1/2" along with the individual objects.

I saw mention of PyClassMembersProvider but couldn't really grasp how I'd use it.

I currently have a CompletionContributor which does provide generic lookups (haven't got much further). 

Any input would be appreciated.

0
1 comment

See com.jetbrains.python.codeInsight.stdlib.PyStdlibClassMembersProvider#getMembers as a sample implementation.

0

Please sign in to leave a comment.