32

I am seeing an error in this yellow box in IntelliJ. How to copy it out to system clipboard?

enter image description here

In Eclipse, there is a good way of doing so. How to do this in IntelliJ?

1
  • I've not had a use case in which I wanted to copy a tooltip error to the clipboard? Why do you want to? Why don't you attempt to auto-fix the issue (Alt + Enter or Option + Enter)?
    – Makoto
    Dec 24, 2013 at 22:21

7 Answers 7

25

The following approach works for me on Windows 8.1 and IDEA 14.1:

Move the caret to the error location. The error message appears on the left side of the status bar below. Right-click the error message - a context menu containing a command "Copy" appears. Select the command "Copy". Voila, the error message is in the clipboard.

Context menu

2
  • 3
    Seems like a good workaround, but unfortunately it doesn't work in Linux version: the copy menu just doesn't appear when I left-click. Relevant feature request: youtrack.jetbrains.com/issue/IDEA-65636
    – gvlasov
    Nov 10, 2015 at 18:33
  • 1
    Almost, but no cigar. How would you copy the whole text that appears in the expanded tooltip (ctrl+F1)?
    – Adam
    Nov 4, 2016 at 11:53
11

UPDATE for newer versions of Idea family (works for me in Webstorm 2019.3 in Ubuntu 18.04.3): just select the error text inside the bubble and press Ctrl+C. Thank you, Jetbrains.


Long-awaited solution for Linux version: press Ctrl+Alt+left mouse button on the tooltip - and you've got it in your clipboard :)

The solution doesn't seem to be documented anywhere (correct me if I'm wrong), although it works nice.

3
  • 1
    Holly smokes, indeed that works!!! I wonder how you came up with it? :)
    – taxo
    Jul 17, 2018 at 8:59
  • @taxo, bruteforce :D
    – grreeenn
    Jul 23, 2018 at 14:48
  • Works in Ubuntu 19.10 ;) Kudos! Sep 17, 2019 at 12:50
4

When the tooltip appears - select the text with the mouse, but hold the mouse button down until you press Ctrl+C. This works for me with IntelliJ 13.1 on Ubuntu 14.04.

0
3

For MacOS 10.5+ Android Studio 3.5:

1. Hover over the code snippet

2. Carefully move the cursor to warning text through bubble as below(otherwise warning text may disappear)

3 Tripple click on the warning and then Control + Alt + click.

1

On the right side of an editor field you can see a red mark that represents your error in the line. If you hover over it, you see the same message tooltip. Quickly move over it and press the mouse button to select the text. It worked in my case.

I have the feeling that this tooltip is a lot easier to select than the tooltip that appears if you hover over the text!

enter image description here

3
  • 3
    No...they're tooltips. Once you move your cursor away from the error location, it's gone.
    – Makoto
    Dec 24, 2013 at 22:42
  • 1
    That is correct, but am able to select them anyway if I quickly move over them and press down the mouse button to select them.
    – pogopaule
    Dec 24, 2013 at 22:44
  • 1
    I'm convinced that's non-standard behavior. It certainly doesn't seem intentional.
    – Makoto
    Dec 24, 2013 at 22:45
1

There isn't an easy way to select the tooltips' text, from my experience, and paste it somewhere else.

Note, however, that depending on what you're analyzing, and the type of error you're getting, the information can be gleaned from the Inspections tool.

Even that won't provide context for you; in this case, the output you're seeing is equivalent to what you'd get if you compiled the Java class. In that case, you'd see the output in the Make window instead.

0

@Vladimir's solution didn't work for me, what I did is just rebuilding the project and copying the error from the message window.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.