How do I copy and paste the tooltip error message that pops up in IntelliJ IDEA? - intellij-idea

IntelliJ IDEA automatically shows a red line if it cannot resolve some entities or it detects an error. Is there a way to copy and paste the content of that tooltip?

With eclipse I use the f2 to get the information.
I used the idea version 14.1.4 and use this way to copy the tooltips.
You can click the error line and the info will display, now you can right click to copy this error info.

Mouse shortcut:
Hover mouse over error in editor to bring up tooltip
Alt + click on error message inside tooltip to copy it to clipboard
For step 1 you can also bring up the tooltip for the current carret position by Ctrl + F1. For step 2 there does not seem to exist a keyboard shortcut at the time of writing (for IntelliJ 2018.1), see also IDEA-65636.

If you stumbled upon looking for solution for Linux version (and none of the above worked for you, like for me) click ctrl+alt+left mouse button on the tooltip, and you'll get its content into the clipboard :)

No, the tooltips don't offer a way to get that information from their context alone.
You could traditionally compile it instead via Build -> Compile and get the error message that way, instead. You can then select this text and do with it what you wish.

There is a bug report on this since 2011 (!) . Feel free /encouraged to vote for having the bug fixed:
https://youtrack.jetbrains.com/issue/IDEA-65636
IDEA-65636 I can't copy text from tooltip, though I can select it
Though honestly JetBrains infrequently gets around to non super critical bug fixes.

Related

Java doc overlap the error message in IntelliJ IDEA

I am using IntelliJ IDEA (2016.3) linux version for Java development. As shown in the image below when the mouse pointer hover over an error line, the error message is overlapped by the javadoc making it harder to read the given error message. How to fix this?. Thanks in advance
I use 2017.1.3 EAP on Win10 and it is the same. Seems like a bug.
There are several workarounds:
Set time delay for documentation popup to a higher value. This should give you more time to read the error message. (Settings -> Editor -> General -> Show quick documentation on mouse move).
Set a cursor at the code with the error and you will see a duplicated error message in the status bar.
You can also have the documentation in a fixed spot by clicking the pin in the top right corner of the pop-up. The window will then always be there, but it does update on mouse-overs and it is not over the warning- and errormessages anymore.
This happened to me in Android Studio and I've just removed documentation on mouse hover setting and set a Shortcut Key (Alt+D) for that. This is more comfortable for me.

Atom: Imitate 'Shift-Enter' keybinding of IntelliJ

In IntelliJ IDEA, one of the more helpful commands I've found is 'Shift-Enter' - it effectively moves the cursor to the end of the line, and starts a new line, thus not affecting the text on the current line.
I'd like to re-create this in Atom, but I can't seem to figure out how one would go about doing so. It doesn't look like you can have multiple editor actions for a given key combination, and I'm not sure if I simply can't find the esoteric editor command I'm looking for.
How can I recreate the behavior of shift-enter in IntelliJ for Atom?
As it so happens, I stumbled across the shortcut: You can use cmd-enter to do the same action. I'm not sure what the underlying command is, but I hope this is helpful to other people!
You can recreate this behaviour by adding this to your keymap:
'atom-workspace atom-text-editor:not([mini])':
'shift-enter': 'editor:newline-below'
Detailed answer;
Freshly open atom editor
Open Keymap option
Copy this and paste this;
'atom-workspace atom-text-editor:not([mini])':
'shift-enter': 'editor:newline-below'
Click save and close the file
Press Shift and enter, Now you'll be able to form a new line below the line you currently in are regardless of the place you are typing in.

keyboard command to focus on erroneous text in IntelliJ IDE

In eclipse when you hover over some erroneous text you can press F2 to focus there. What is the equivalent procedure in IntelliJ?
Whenever I put my pointer over some error the text describing it disappears.
In Eclipse it will suggest what I can do to fix something like an unhandled IO exception. I'm sure IntelliJ can also do this because some people I know who are quite skillful programmers highly recommended it to me, but- how to do this?
That is: hover over some text at is in error, see what the error is, the options to fix it, and then choose one.
If you click on the highlighted part of code, the error description will appear in a pop-up bubble as well as in statusbar.
You can then hit ALT+Enter which will offer you some options to handle the given error/warning or to disable the warning.
The actions you are looking for is called "Error Description" and "Show Intention Actions".
⌘+F1 (Ctrl+F1 on non-mac) will show the error info on based on where the caret is.
Alt+Enter will show the Intention Actions available based of the location of the caret.

IntelliJ: Move to next typo

IntelliJ IDEA has an inspection that checks for spelling. In the analysis overview, I can see how many spelling mistakes were found, e.g. 12 typos found. In the code they are highlighted using a wavy green line.
However, I find it very hard to look manually for those wavy lines. Is there a keyboard shortcut or a search function which will automatically skip to the next highlighted typo?
F2 and Shift + F2 shortcuts will navigate you to the Next / Previous highlighted error. You need to configure the error navigation first to Go to next problem instead of default Go to high priority problems option(from the context menu of editor right side bar):
See help for details. Another option is to use double click (F4 shortcut) from the Inspection Results window to go to the source.
IntelliJ IDEA 2016.3
If you want to fix all typos from the project, you can list all of them and iterate through them using double click (or F4 to open the source):
Analyze > Run Inspection by Name...
Type "Typo"
You will be able to see a list containing all typos grouped by file:
In Settings -> Editor -> Colors & Fonts -> General, you can add an 'Error stripe mark' color to Typo.
With the default settings of IntelliJ I find it difficult to spot the typos. So I do the following hack to spot and correct them once in a while.
Temporarily change inspection setting to show Typos as Errors.
IntelliJ then highlights the typos as Errors, making it much easier to spot them in the editor. I correct them and then revert the inspection setting changes. The changes can be kept permanently but I don't prefer that!

Keyboard shortcut to display error in IntelliJ

I like to use my mouse as little as possible for health reasons. Almost all the common tasks in IntelliJ I can do via keyboard shortcuts, except for displaying the message of an error. How can I have a keyboard shortcut that will show the tooltip of the highlighted error?
For example, I have an error such as:
Then I hit [magic-keyboard-command] and I get:
In Eclipse this is possible by pressing F2. Is there an equivalent in IntelliJ?
The standard Error Description shortcut for JetBrains tools is Ctrl+F1 (Cmd+F1 on Mac).
I use F2 on the mac, it cycles round all the errors in a single file and displays the error information for each.
In addition, to find all project errors what I do is this:
cmd+2 - go to error list (this might be different for diff languages)
press enter key
make change to fix bug
back to step 1 (sometimes escape key will help also)