can the custom tag files handle classes so it only autocompletes methods under the class, so if i type myclass. it woudl then list func1 func2 and func3 so if i declare test as an instance of myclass typing test. should also list the methods.
Can we currently do this ? and if we can whats the format for the tags file ?
myclass: def func1(): pass def func2(): pass def func3(): pass
test=myclass()
On 30 September 2010 17:44, Oliver Marks oliver.marks@gforces.co.uk wrote:
can the custom tag files handle classes so it only autocompletes methods under the class, so if i type myclass. it woudl then list func1 func2 and func3 so if i declare test as an instance of myclass typing test. should also list the methods.
Can we currently do this ? and if we can whats the format for the tags file ?
myclass: def func1(): pass def func2(): pass def func3(): pass
Hi Oliver,
The Python tag manager already recognises things like the above, shows them in the symbols sidebar and can dump tagfiles (as described in the manual).
Unfortunately it can't go any further, because Python is a dynamic language, recognising that test has func1, func2 and func3 can only be done at runtime.
The line test=myclass() is an assignment statement, not a declaration that test is of class myclass. Test only gets a type at runtime when the statement is evaluated. Until you trace execution it is not possible to be sure that myclass() is a constructor, rather than just a plain function.
Also all the functions of a class's parent classes are also available, functions can be added to classes dynamically and variables in classes are also candidates for use after test. None of these can be determined until runtime.
Especially since member variables are only added when assigned to (usually in __init__ but that not the only way) again its not possible to know what to offer until runtime.
Scope specific completion is available for C like languages because they are statically typed, each variable has its type declared and the type has all its members declared, so its possible to know what can be offered.
Cheers Lex
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
On 08.10.2010 23:43, Lex Trotman wrote:
Scope specific completion is available for C like languages because they are statically typed, each variable has its type declared and the type has all its members declared, so its possible to know what can be offered.
Cheers Lex
Scope completion isn't working correctly anyway. r4840 tried to address it but it was reverted since it introduced a different bug.
Best regards.