Xcode shortcut for jumping to implementation of a method? - iphone

Is there a keyboard shortcut in Xcode for jumping to the implementation of a method? I am aware of the fact the command+click will jump to definition, but I want to jump to the implementation method, not the definition. Also, I want to use keyboard shortcuts, with no involvement of the mouse (including clicks).

Keyboard shortcut for 'jump to definition' in XCode 4.5: Control-Command-J
Another useful shortcut after jumping to definition is Control-Command-Left (which takes you back).

Command + click will work, If you want "keyboard only" shortcut you need to map it under Preferences->key bindings->Edit->Find->jump to definition

Hold Command and click on the method you want to see it's implementation.

Related

Is there a hotkey in Eclipse to "Open declared type"?

When hovering over a variable, one can go straight to its definition pressing F3. But what I'm looking for is for a way to go directly to its type definition, which I'm currently doing by pressing CTRL + clicking "Open declared type".
Is there a easier way to do this?
Assign a key stroke for 'Navigate > Open Hyperlink' command via 'Preferences > Keys'. (I use F6)
Now you can use this key stroke instead of using Ctrl+Click to bring up the hyperlink popup.
Not exactly what you are looking for, but this is the best solution I think.
There is another option, using Ctrl+Shift+t. This opens a window where you can look up any type you wish. This becomes a shortcut when you highlight your target, press Ctrl+Shift+t and hit enter. Imho Ctrl+Click is still faster.
If you would like to check any other shortcuts bind keys go to Windows -> Preferences -> General -> Keys
I've always relied on a combination of ctrl+shift+t and the hover options. I never thought of the key stroke assignment. I might try mapping a scroll button click, like opening a link in a new tab.
in Windows > Preferences > Keys
search for Go to Type and assign it a ctrl-f3 or shift-f3 (there is a conflict with ctrl-f3)

What are the shortcut keys to change to the next and previous tab in Eclipse on Mac OS X?

I want to be able to switch from one file to another in the Eclipse editor (in the Java perspective) from the keyboard (and bind those key combinations to buttons on my mouse). What are the shortcut keys for switching the current tab to the next or previous?
Mac OS X:
Fn+Cntrl+↑
Fn+Cntrl+↓
Effectively Cntrl+page up/page down as given in the first comment for #wibbe01's answer.
According to this thread, switching editors are:
Shift+Command+F6
Command+F6
, which you can remap to:
Shift+Command+Tab
Command+Tab
Note, as mentioned in that same thread:
Command+E lists all the opened editors, allowing to quickly select one
Shift+Command+L lists all the active key bindings.
The bug 86248 helped introduced the Cntrl+↑ and Cntrl+↓, which Bjorn Tipling reports working on Mac with a Fn in front of it.
If I were you I would just go to the eclipse menu, then preferences. Under the general section of the tree there is a section called "Keys" In there you will find things for "Next Editor" or whatever other keyboard shortcuts you are looking for. Map them to what makes sense to you....then you're happy like this :) or maybe even like this :D.
Enjoy.
In Eclipse's preference panel, go to Keys. The command is called Next Tab and Previous Tab, just map these to whatever you want. In my case since I normally use mvim are:
⌘+⇧+[
⌘+⇧+]
You can change all shortcut keys in preferences by pressing ctrl+shift+L 2 times . Switching tab in Eclipse (ctrl+F6) is not easy to press. So you can make it ctrl+tab or whatever you want.
Since I have my F keys mapped to the default setting, I had to use fn-command-F8
I figured it out by first confirming command-F8 was indeed mapped under command-shift-L

Jump into interface implementation in Eclipse IDE

You know how in Eclipse, pressing F3 over a method will take you to its declaration? Well I have a method that is part of an interface; clicking F3 over this naturally takes me to the declaring interface.
Obviously there is an object implementing this interface and this is where the method is actually implemented. I want, when I press F3, to jump to the implementation, not the interface declaration. I know that the implementation may not be known at compile-time, so is there a way for Eclipse to show me all the classes implementing the interface so that I can select which implemented method to view? Right now when this happens I am just manually searching for this to find the implemented method.
Here's what I do:
In the interface, move the cursor to the method name. Press F4. => Type Hierarchy view appears
In the lower part of the view, the method should already be selected. In its toolbar, click "Lock view and show members in hierarchy" (should be the leftmost toolbar icon).
In the upper part of the view, you can browse through all implementations of the method.
The procedure isn't very quick, but it gives you a good overview.
Well... well... I hope you use Eclipse Helios, because what you asked is available on Helios.
Put your text cursor again on the method and click menu Navigate → Open Implementation. Now if you have more than one implementation of the method, you will get choice to pick which implementation to open.
By defining a keybinding on Preferences → General → Keys you can even use the feature easier, but before you do that, see if this shortcut is fast enough for you.
Press Ctrl + click and hold. Now move your mouse over the same method. Tadam… you will get choice.
If you pick Open Implementation you’ll get the same choice as before.
Press Ctrl + T on the method name (rather than F3). This gives the type hierarchy as a pop-up so is slightly faster than using F4 and the type hierarchy view.
Also, when done on a method, subtypes that don't implement/override the method will be greyed out, and when you double click on a class in the list it will take you straight to the method in that class.
There's a big productivity boost if you add an Alt + F3 key binding to the Open Implementation feature, and just use F3 to go to interfaces, and Alt + F3 to go to implementations.
Highlight an interface and use Ctrl+T to open "Quick Type Hierarchy".
ctrl + mouse hover + click "Open Implementation"
On ctrl + hover, you should see the following menu:
Tested on Eclipse Mars.2 (4.5.2)
Here is what I do:
I press command (on Mac, probably control on PC) and then hover over the method or class. When you do this a popup window will appear with the choices "Open Declaration", "Open Implementation", "Open Return Type". You can then click on what you want and Eclipse brings you right there. I believe this works for version 3.6 and up.
It is just as quick as IntelliJ I think.
See In eclipse, ctrl-click goes to the declaration of the method I clicked. For interfaces with one implementation, how can I just directly to that implementation? for some alternative solutions.
Anyway, I think you might be looking for something like this:
http://eclipse-tools.sourceforge.net/implementors/
I always use this implementors plugin to find all the implementation of an Interface
http://eclipse-tools.sourceforge.net/updates/
it's my favorite and the best
If you are really looking to speed your code navigation, you might want to take a look at nWire for Java. It is a code exploration plugin for Eclipse. You can instantly see all the related artifacts. So, in that case, you will focus on the method call and instantly see all possible implementations, declarations, invocations, etc.
The best solution would be Ctrl+Alt+I.

Faster way (keyboard shortcuts?) to use quick fixes in Eclipse?

I often use the Eclipse feature (Galileo) of suggested error corrections to automatically create code stubs or to refactor things. For example, I would write a method that calls other methods which don't exist yet, then move the mouse over the error message and click on "create method". Or, change this to the class name and choose "add static modifier" from the quick fixes.
I think this is very convenient because it lets me stay in one place in my code and sort of "remotely" wire up what's not currently visible on my screen. What I think is annoying though, is that I have to leave the keyboard, hover my mouse over the error symbol, wait for the tooltip to pop up, and click on the option (doing that, I sometimes move the mouse a little over the edge and the tooltip goes away again - very annoying).
Am I missing a faster method here? I can't seem to find a keyboard shortcut, but then I have overlooked stuff from the huge preference dialog before.
Ctrl+1 : Quick Fix.
(Cmd+1 on Mac)
Just put your cursor on the part you suspect you can perform an action (correction, refactoring, ...) and hit the Quick Fix shortcut. The same popup will be displayed, and you can select the right option with the up and down keys.
That, combined with Ctrl+3 (Quick Access) gives you most of eclipse features at your fingertips ;)
See also:
Eclipse Tip: Shortcut to Quick Fix
My Favorite Eclipse Shortcut: Quick Fix
Eclipse hotkeys: eclipse shortcuts gold mine.
As an additional tip, a specific type of quick fix I use all the time has a dedicated shortcut:
Alt+Shift+J: Add Javadoc comment stub for current method.
After using ctrl+1 like mentioned in the top answer, press ctrl + enter to apply the selected fix all to problems of the same category.
In general, keyboard shortcuts in IDEs (and code tools in general) are coming from a user principle that holds that the more your hands/fingers can remain poised over the keyboard (as in the f-j centered "touch typist" position), the more productive you can become. This is probably why the use of the number keypad is not encouraged, or other keys, less common to the most basic layout keyboard, are not used. Many hold that useful keyboard shortcuts should be easily reachable from this position.
One thing I will say about eclipse keyboard shortcuts is that if you use a popular Windows presentation utility called Zoom-it, you need to turn that off when using eclipse. There are several show-stopper conflicts between the two, such as Ctrl-1 and Ctrl-3.

Possible to view method / function docs in NetBeans?

NetBeans 6.5 with Python support provides the docstring documentation for a function/method in a popup when auto-completing, but is there another way to view docstrings?
Perhaps achieved by mousing over a function/method name, or clicking somewhere?
The best I can seem to do is "Go to source" in the right-click menu.
I received the following answer from Tor Norbye at Sun:
Hold the ctrl key (or Cmd on Mac) and then hover.
Also, Ctrl-Shift-Space (e.g. code completion + shift) will display -just- the completion doc (which means it doesn't just look at the prefix of the caret, but the whole identifier and left hand side type if it can resolve it, to compute one specific match rather than many).
You can also use this keyboard shortcut on Mac. Shift + Meta + Backslash
You may be referring to the function Show Documentation Popup in Netbeans
Try
Ctrl+Shift+SPACE or
Ctrl+Shift+BACK_SLASH
related: How to see Javadoc documentation on mouse hover in NetBeans?