-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi, Sorry for the latency, I was busy these last days.
Then, I have some questions: * Is it possible to get tags for the current function, or at least function's start line, from inside a plugin?
Not directly. Without having tested, it should be possible to get the tag list for a document by using the 'tm_file' field of the GeanyDocument structure.
GeanyDocument *doc; TMWorkObject *tm_wo = doc->tm_file; GPtrArray *tags = tm_wo->tags_array;
This should give you an array of TMTag objects for the current file, then you can search this array for the corresponding TMTag object of the desired line in the document or function name or whatever. The above is untested but should work or at least should suffice as a start to get it working :).
Perfect, it works well :) But I need to update the tag list manually to generate correct documentation and insert it a the right place, but even if it can be found in the online API doc and in tm_source_file.[ch], tm_source_file_buffer_update() seems not usable from plugins (gets me an undefined symbol error). Is it normal? If yes, is there another way to update tag list dynamically?
The pointer to the submenu item you want can be retrieved with:
ui_lookup_widget(geany->main_widgets->editor_menu, "comments");
Don't forget to destroy the create menu item(s) in plugin_cleanup().
In case you want show/hide/update the menu item when the editor menu is actually shown, you need to connect to the "update-editor-menu" signal.
Thanks again, it's exactly what I was searching for. But again, a question: how can I know the click position that popuped the menu (and perhaps if it was popuped by a click and not a keyboard shortcut) to be able to generate the doc for the function below pointer and not at current position in the buffer?
Thanks a lot for support! Regards, Colomban