Sublime Forum

Possible to redirect / proxy goto definition invocation?

#1

I would like to add goto definition functionality to Drupal for theme functions. In Drupal, calls to theme('the_theme_function') generally invoke 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

0 Likes

#2

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.

0 Likes