Home Download Buy Blog Forum Support

Possible to redirect / proxy goto definition invocation?

Possible to redirect / proxy goto definition invocation?

Postby James Andres on Thu May 09, 2013 3:42 pm

I would like to add goto definition functionality to Drupal for theme functions. In Drupal, calls to
Code: Select all
theme('the_theme_function')
generally invoke
Code: Select all
theme_the_theme_function
on the backend.

Is it is possible to catch the invokation of goto definition right before it fails and reroute the invokation to to theme_$SELECTION?

Thanks,

James
James Andres
 
Posts: 4
Joined: Sun Feb 24, 2013 9:03 pm

Re: Possible to redirect / proxy goto definition invocation?

Postby jps on Mon May 13, 2013 12:51 am

You can listen to the on_window_command event, and optionally rewrite the command to a different one. In this case, you'd need to listen for the goto_definition command, and rewrite it when desired to set an explicit 'symbol' parameter, rather than letting it use the symbol name under the caret.
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 14 guests