tags:

views:

246

answers:

1

I'm looking for a keyboard only shortcut for Jump to Definition. The built-in shortcut requires the mouse: Cmd + Double click.

I've tried to add a regular keyboard shorcut for the Edit / Find / Jump to Defintion menu command, but, alas, it will only work when the method name is selected. I'd like to be able to position the cursor within the method name, class name, or other symbol, and hit something like Cmd+Shift+L.

Does anyone know of a solution, perhaps using a script, for the problem?

Update: The keyboard shortcut works sometimes and sometimes not. When I position the text cursor on a method call with no parameters and press Cmd+Shift+L it takes me to the definition. But it doesn't work for a method that takes an (id) parameter. However it works if the parameter is an int.

I have submitted a bug report to Apple.

A: 

Try the following: Cmd + Option + Up (or Cmd + Shift + D and select from list) or see this link re assigning shortcuts (this last option is probably what you tried already - it may require selecting the method).

Ramashalanka
That will take me to the header file, or the declaration. I need to get to the code, the definition. And yes, I've tried the shortcut re-assigning.
Arne Evertsson
Yes, I see that's your comment on the SU link, sorry. When I set up the keyboard shortcut *Cmd + Shift + J* for the menu item *Jump to Definition*, it seems to work (in Xcode 3.2.1), even when the cursor is in a method, but I don't have any selection. By the cursor I mean the flashing text insertion cursor, not the mouse pointer. Sorry, I'm being a bit slow, but perhaps you could give an example of where it doesn't work?
Ramashalanka