[Geany-devel] Function Definition

Enrico Tröger enrico.troeger at xxxxx
Sun Apr 18 08:44:04 UTC 2010

On Fri, 16 Apr 2010 20:39:59 +0200, Colomban wrote:

>jordan a écrit :
>>> As Enzo said, there is the scope to determine if a particular line
>>> is part of a function or not, but its is not supported by every tag
>>> generator used by Geany. What I personally chose was to walk the tag
>>> list and find the tag closest to the current line. Tweaking this
>>> way a bit gives quite good results.
>>> And for the function definition, see the tag list, there is
>>> everything you probably want (or almost). One missing thing is the
>>> argument list – I personally chose to fix this with a regular
>>> expression, but there might be better solutions; for example if
>>> hard-coded things are acceptable, a custom argument parser is a
>>> somewhat easy task.
>> How do I access the scope, or this tag list you speak of, I noticed
>> nothing like that in plug-in api documentation?
>See the tm_file field of GeanyDocument. I don't know exactly for the
>scope, but the tag list is doc->tm_file->tags_array.

An alternative way is using symbols_get_current_function() but this is
currently not part of the plugin API. But we could add it if requested.


Get my GPG key from http://www.uvena.de/pub.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20100418/ab01a1a0/attachment.pgp>

More information about the Devel mailing list