On Fri, 27 Feb 2009 00:12:22 +0530, Manish wrote:
Hey,
The issue of this mail was more than just getting 0.16! I wanted to know how to contribute to Geany 0.16 Python autocomplete. I have the source code for 0.16 on my system and want to enhance the feature. Can you give me a few pointers on how to do so. Which files have this code for doing so. Any docs in any form would be welcome :)
Glad to hear you are now on 0.16, this makes things easier :).
Geany has a file named python.tags, probably located in /usr/share/geany on your system. This files contains the available symbol names for Python. It is created by the script at [1]. However, this is far from being good. For instance, the symbol completion is not context-sensitive, i.e. it doesn't take into account of which class the current object is when showing completions. It is a more or less a basic or stupid completion without any scope information.
To improve this the key is to parse the object before the dot when starting an auto completion. But to get it's name is obviously not enough as we need to know it's type and there it becomes tricky. If you really want to step in and improve things, dig into src/editor.c in editor_start_auto_complete() and then find your way down to the internals :). In case you need any help, feel welcome to ask.
Anyway, the current state of Python auto completion isn't that bad, IMO. It still helps to quickly complete a few often used methods and constants.
[1] http://geany.svn.sf.net/viewvc/geany/trunk/scripts/create_py_tags.py?view=ma...
Regards, Enrico