Skip to main content
blog title image

2 minute read - FAQ IntelliJ Java For Testers

Some Handy IntelliJ Code Completion Keyboard Short Cut Tips

Jun 20, 2013

There are plent of shortcut keys and approaches to writing code that IntelliJ will help with.

Assuming you chose IntelliJ as your Java IDE, and why wouldn’t you?

There are a few tips I want to pass on for helping with code completion.

I assume you already know Ctrl+Space to start code completion.

In the code completion pop-up you can use Ctrl+Q to see the JavaDoc help for that method.

And if you get stuck with the parameters for a method then Ctrl+P can show you what options are available.

When there is an error in your code, using Alt+Enter or Option+Enter you can see a set of ‘Intentions’ which offer actions to take to potentially fix the code e.g. import a specific package, wrap with try catch etc.

I frequently use this to write code e.g. I might call a method and assign the return value to a variable:

bob = returnAValue();

This would be syntactically incorrect because I haven’t declared bob so I’ll use Alt+Enter to automatically add the correct type for bob and IntelliJ will rewrite my code to be correct:

String bob = returnAValue();

The fast way to navigate and find ’things’ (classes, methods, functionality) is to quickly press ‘shift’ twice. And then there is a super powered search dialog to find pretty much anything you can think of.

You could try installing Key Promoter X which is an IntelliJ Plugin that shows short cut keys for actions that you take in the IDE.

You could also install IDE Features Trainer and this will guide you through the learning of the features of the IDE.