Selecting currently active method in Structure pane in IntelliJ - intellij-idea

In IntelliJ, when I'm looking at my code and have the Structure pane open listing all the classes, methods and member variables, it would be nice if IntelliJ could automatically highlight the name of the method that my cursor is located in within the code window. As it stands, I have to manually scroll to the start of the method to figure out the name and then look in the Structure pane to figure out where it is located when I need to navigate back to it when I scroll my code window.

The toolbar of the Structure pane has a button called "Autoscroll from source". Pushing it will give you the behavior you want.

Related

Intellij not displaying file when clicking on it in project view

When I click on a file in the project view, it shows me a dropdown listing all the methods in the file.
I don't want that - I just want it to display the file on the main window.
How do I accomplish this?
Right click on the Project title bar or click Show Options Menu cog, and deselect Show Members:
If this option is on, the files in the tree that contain classes turn
into nodes. When such node is unfolded, the contained classes with
their fields, methods, and other members of the selected item are
shown.

How to see class structure window in addition to project window in IntelliJ?

I can see the structure of a class in IntelliJ by View --> Tool Windows --> Structure, however, that replaces the existing project window (with the project hierarchy) on the left.
How can I see both windows, keep the project on the left, and the structure on the right with the editor sandwiched in between? That way I see where the class fits in the big picture on the left and the details of the class on the right.
After you open structure: left click the wheel -> Move to -> Right
Than Open project again.
This will give you the "sandwich" you wanted.
Just click on the little settings wheel in the structure window's toolbar and select "Split Mode".
A little more intuitive way: Make the Toolbuttons visible (in the "View" menu) and just drag the "Structure" toolbutton down (or to another side).

IntelliJ IDEA - detach editor window

I have recently removed tabs from my IntelliJ setup, because with all the features available to navigate between files, who needs them?
The issue is, the normal way of detaching an editor window would be to drag the tab onto another screen (or area). There doesn't appear to be anything in the key mappings for detaching an editor window. Is there a way of doing this via the keyboard?
The keyboard shortcut your are looking for is SHIFT+F4 (the action assigned to this shortcut is called Open Source in New Window. When you invoke this action the currently opened tab (file) will be opened in new editor window. However the file will remain opened in the main window too, but I believe that this is as close as you can get to the functionality you describe, at least for now.
Option 2
Open the "Open class" dialog using CTRL+N search for a class you want to open in detached window and hit CTRL+SHIFT+ENTER. That will open the class in a new editor window.
Unfortunately this seems to work only for Java classes and not for other files (CTRL+SHIFT+N dialog). I created a bug report for the last problem, so if you think it might be useful, feel free to vote for it.

How do I find in Xcode all caller functions of a specific function like eclipse's Call Hierarchy?

how do I find in XCode all caller functions of a specific function like eclipse's Call Hierarchy
Since the release of XCode 4.4, this functionality exists and is called "show related items".
There are multiple ways of accessing the pop-up menu that will allow you to view all callers and callees, among other things.
The fastest way is:
Mark method in code (using your cursor or double click name)
Press Ctrl+1
Select "Callers" from the pop-up menu
You can also go View->Standard Editor->show related items or press the tiny button just left of the arrow buttons in the line just above the editor window (where it shows your currently selected file and method).
There is a hotkey —> ^CmdShift + H

Is there a way in Intellij IDEA to see the name of the method the current line belongs to?

In our code base there are a few very long methods (several pages worth of code). When reading the code, it would sometimes be good to be able to see the name of the method the current line belongs to, without paging up to the beginning of the method. Is this possible in Intellij IDEA? I am using Intellij IDEA 7.0.3.
You can use View | Context Info (Alt+Q, Ctrl+Shift+Q on Macs). It will display a pop-up on the top of the editor with the current context information (class/method signature).
IntelliJ 2018
This is shown by default at the bottom.
Unfortunately, the method is shown only by name (not including the parameters). If a method is overloaded you won't know for sure where you are.
If you want to move it from bottom to top, go to File > Settings... > Editor > General > Breadcrumbs > check Top:
In the structure panel select the "Autoscroll from source" option.
This way when you place the cursor inside any method the structure panel will show which method you're in.
Intellij now has support for breadcrumbs. Go to settings > appearance and tick "Show breadcrumbs". In this way you can view class/method name without Alt+Q.
For some reason (Alt-Q) wasn't consistent in Android Studio for me. I find (Ctrl-F12) to be pretty satisfactory for this purpose (Navigate|File Structure) though it can be a little laggy in larger files. And by pressing the hotkey again it will populate the list with all the inherited methods as well.