Intellij has this cool feature where if you type ctrl+alt+c
, it copies the absolute path of the file your cursor is in to your clipboard. I want something similar, but instead of the file path I want the path to the method my cursor is on. For example, look at this class:
package com.sandbox;
public class Sandbox {
public void doSomething() {
}
}
If I put my cursor on/in doSomething()
, I'd like to press some keyboard command that will put "com.sandbox.Sandbox#doSomething()" into my clipboard. If my cursor is in the method, it would be even better if it could put this into my clipboard: "com.sandbox.Sandbox#doSomething():line 45" as the line my cursor was on when I typed the command.
Here's why I want this: I often write emails/instant message other developers and need to tell them to "look at this". It's very easy to get the method name because I'm usually already there. But then I need to scroll up to the class name to tell them the class and I lose my place on the method. I do this often enough in a day that I think I could get some benefit into automating this process.
CTRL+ALT+SHIFT+C is "Copy Reference" which should do what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With