Intellij-IDEA: how to put a method path in my clipboard

Intellij has this cool function, where if you type ctrl+alt+c , it copies the absolute path to the file your cursor is in to your clipboard. I want something similar, but instead of the path to the file, I want the path to the method to be included with my cursor. For example, look at this class:

 package com.sandbox; public class Sandbox { public void doSomething() { } } 

If I placed my cursor in / in doSomething() , I would like to press some keyboard command that will put "com.sandbox.Sandbox # doSomething ()" in my clipboard. If my cursor is in a method, it would be even better if he could put it on my clipboard: "com.sandbox.Sandbox # doSomething (): line 45" as a line, my cursor was turned on when I typed a command.

That's why I want this: I often write an email / instant message to other developers and have to tell them to "look at it." It is very easy to get the name of the method, because I'm usually already there. But then I need to scroll to the class name to tell them about the class, and I lost my place in the method. I do this often enough during the day, which, I think, could be of some benefit to automate this process.

+4
source share
2 answers

CTRL + ALT + SHIFT + C is Copy Link, which should do what you want.

+4
source

In fact, "Copy Link" is very close to this: By default, Ctrl+Alt+Shift-C . Please note that Ctrl-Shift-A (Find Action) is your friend and will show you the above link.

This method will not add a line number.

+2
source

All Articles