<br><br><div class="gmail_quote">On 2 October 2012 00:00, Rory Michele <span dir="ltr"><<a href="mailto:zaibatzu@gmx.net" target="_blank">zaibatzu@gmx.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi guys,<br>
<br>
I'm looking for help. To give you my level: I work as a (mostly ruby and<br>
java) programmer and have some experience on that level, but this would<br>
be my first bigger open-source project that I work on. So please be kind ;)<br></blockquote><div><br></div><div><br></div><div>Hi Welcome, </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
<br>
I would like to write a geany plugin trying to provide helpful ruby<br>
refactoring (I think thats the word, what I mean is looking up<br>
(possible) declarations and usages), that can extend or replace the<br>
functionality of "go to tag declaration/definition". I wish for that<br>
because the current implementation looks only in open files as far as I<br>
understand and I would like to provide this on a project basis, therefor<br>
scanning also files not currently opened in geany.<br></blockquote><div><br></div><div>Have you looked at both the project plugins, I think one or both do this?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
I know this is very intensiv to provide for ruby, however I'm thinking<br>
to provide it only at explicit wish (e.g. special button), not to bother<br>
the slim and fast design of geany. And as I'm doing the same for<br>
"reverse engineering"/understanding geany right now with grep, I think<br>
it should be possible at reasonable speed, unlike these java<br>
implementations that they scan and index all at the beginning and kill<br>
my memory ;) Now what do you think, is it appropriate to provide this<br>
for geany or is it against a concept or something?<br></blockquote><div><br></div><div>I am not sure I understand what you are proposing, since would your plugin not also "kill your memory" if it scans everything? It just won't do it until you press the magic key.</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
The features I currently have in mind:<br>
 - a menu-point and keybinding for navigating to possible declarations<br>
 - a second mode for auto-completion (maybe pressing space another<br>
time), that looks up possible classes the selected instance is of, to<br>
show only relevant tags for autocompletion<br>
 - a menu-point and keybinding for listing possible usages (and the<br>
possibility to navigate there)<br></blockquote><div><br></div><div>Just from a user point of view it might be better if your plugin just replaced the Geany functionality rather than being an additional function, but I guess that can be found by experiment.</div>
<div><br></div><div>The only one of the above that might be difficult(ish) is the second mode which seems to depend on a key sequence not a simple binding.  Its not impossible, just Geany doesn't do that and so will give you no assistance.  Might be better as another keybinding.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Now the Questions:<br>
I checked the demoplugin so in general I think I have a clue on how to<br>
create the plugin.<br>
Now what seems for me the best way to go would be to simple override the<br>
callbacks for the existing "Go to Definition" etc. keybindings (as the<br>
ui-buttons seem to also be using them). </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The first relevant key_binding_id I would like to overide the callback<br>
for is GEANY_KEYS_GOTO_TAGDECLARATION.<br>
And it is mapped to a function in keybindings.c on line 1886.<br>
Now, this mapping I would like to overide. Is that possible and how? Or<br>
do I have to create new UI-Elements and link them to my function. I<br>
would not like the latter so much as the global settings for keybindings<br>
wouldn't have effect, wouldn't they?<br></blockquote><div><br></div><div>Hmmm, normally plugins don't override existing keybindings, and there is an argument that they should not set any keybindings until the user selects which ones to use.  This is since the user can re-assign keycodes and the plugin can't tell what system or other plugins may be using a particular keycode.  Even if it could tell, it would normally be considered to be rude to just splatter over it :(  This has been a problem in the past with disagreements between plugins.</div>
<div><br></div><div>Normally plugins just add another keybinding section and let the user assign codes, see for instance some of the plugins included with Geany for how to (reasonably) conveniently do this.</div><div><br>
</div><div>As I noted above, in this case you may want to replace the normal functionality when your plugin is active, but I'm not sure it is possible at this time and you might have to intercept the keypress and grab it before Geany sees it.  That of course adds complexity to your plugin and makes the keybinding preferences settings wrong.</div>
<div><br></div><div><br></div><div>Cheers</div><div>Lex</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Thanks for your help and I'll be happy to clarify any questions<br>
rory<br>
_______________________________________________<br>
Geany-devel mailing list<br>
<a href="mailto:Geany-devel@uvena.de">Geany-devel@uvena.de</a><br>
<a href="https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel" target="_blank">https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel</a><br>
</blockquote></div><br>