[wingide-users] Hacking .pi files for better code completion

Tim Mitchell t.mitchell at aranz.com
Tue May 13 15:29:00 MDT 2008


Hi,

I have some enumerated types (using my own variant on the enum package), 
for example:

TIME_UNITS = enum("Undefined", "Seconds", "Minutes", "Hours", "Days", 
"Years")
LENGTH_UNITS = enum("Undefined", "Feet", "Metres", "Centimetres")

The enum function creates a class instance with attributes for each 
value. e.g.
TIME_UNITS.Seconds

Unfortunately there is no way for any source analyser to know this 
(without running the code). 

Is there a way I can hack the .pi file to provide code completion for 
these enumerated types? There will be alot of them (eventually).
I was thinking of something along the lines of running the file with the 
enumerated types and generating a pi file from the module dict.  (this 
would work because the attributes will then exist on the objects).

Cheers,
Tim

-- 
Tim Mitchell
Software Engineer
Applied Research Associates (NZ) Ltd. (www.aranz.com)
Ph: +64 (3) 374-6120 ext: 203
Fax: +64 (3) 374-6130
Skype: tim-mitchell



More information about the wingide-users mailing list