Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
div
classnavigation
HTML Table
width100%
Table Row (tr)
Table Cell (td)
width33%
Align
alignleft
Previous
span
classsep
|
span
classtext
Editor Basics
Table Cell (td)
width33%
Align
aligncenter
Top
span
classsep
|
span
classtext
Quick Start
Table Cell (td)
width33%
Align
alignright
Next
span
classsep
|
span
classtext
Navigation

...

Wiki Markup
{div:class=navigation}
{table:width=100%}
 {tr}
 {td:width=33%} {align:left}[Previous|Editor Basics] {span:class=sep}\| {span}{span:class=text}Editor Basics{span}{align}{td}
 {td:width=33%} {align:center}[Top|Quick Start] {span:class=sep}\| {span}{span:class=text}Quick Start{span}{align} {td}
 {td:width=33%} {align:right}[Next|Navigation] {span:class=sep}\| {span}{span:class=text}Navigation{span}{align} {td}
{tr}
{table}
{div}

Wiki Markup
{redirect: https://www.jetbrains.com/idea/help/auto-completing-code.html

...

|delay

...

=0}

Info

Focused on developer productivity, IntelliJ IDEA provides powerful features for code completion. However, as there are several code completion features, it is important to learn how they work and when it’s best to use each one.

...

Basic completion offers most trivial suggestions for variables, types, methods, expressions, etc. It is worth mentioning that IntellIJ IDEA provides Basic completion automatically when you start typing. This means you don’t need to press any shortcuts to see suggestions. But if you want to call it explicitly, simply press

span
classshortcut
Ctrl
+ Space
span
classshortcut
Wiki Markup
{span:class=shortcut}Ctrl{span}
+
Wiki Markup
{span:class=shortcut}Space{span}
shortcut.

Note, when you call Basic completion twice, it shows you more results, including private members.

...

Additionally to Basic completion, IntelliJ IDEA provides Smart completion which is much more advanced and comprehensive. Smart completion is aware of the expected type and data flow and offers the option relevant to the context. To call Smart completion, press

span
classshortcut
Shift
+
span
classshortcut
Ctrl
+ Space
span
classshortcut
Wiki Markup
{span:class=shortcut}Shift{span}
+
Wiki Markup
{span:class=shortcut}Ctrl{span}
+
Wiki Markup
{span:class=shortcut}Space{span}
.

Note that when you call Smart completion twice, it shows you more results, including chains and non-imported static members.

...

If you select an item from the suggestion list by clicking

Tab
span
classshortcut
Wiki Markup
{span:class=shortcut}Tab{span}
, it will overwrite the identifier at the caret, instead of just inserting the suggestion. This is helpful if you’re editing a part of an identifier, such as a file name.

...

Statement completion automatically adds missing parentheses, brackets, braces and adds the necessary formatting. To complete a statement, just press

span
classshortcut
Shift
+
span
classshortcut
Ctrl
+
span
classshortcut
Enter
(
span
classshortcut
Shift
+
span
classshortcut
Cmd
+ Enter
span
classshortcut
Wiki Markup
{span:class=shortcut}Shift{span}
+
Wiki Markup
{span:class=shortcut}Ctrl{span}
+
Wiki Markup
{span:class=shortcut}Enter{span}
(
Wiki Markup
{span:class=shortcut}Shift{span}
+
Wiki Markup
{span:class=shortcut}Cmd{span}
+
Wiki Markup
{span:class=shortcut}Enter{span}
for Mac).

5. Negating completion

If you select a boolean item from the suggestion list with

!
span
classshortcut
Wiki Markup
{span:class=shortcut}!{span}
, IntelliJ IDEA automatically adds the negation operator to the result.

...

If you want to see the suggested parameters for any method or constructor, just press

span
classshortcut
Ctrl
+
span
classshortcut
P
(
span
classshortcut
Cmd
+ P
span
classshortcut
Wiki Markup
{span:class=shortcut}Ctrl{span}
+
Wiki Markup
{span:class=shortcut}P{span}
(
Wiki Markup
{span:class=shortcut}Cmd{span}
+
Wiki Markup
{span:class=shortcut}P{span}
for Mac). IntelliJ IDEA shows parameter info for every overloaded method or constructor, and highlights the best match for the parameters already typed. This helps you to choose between overloaded options and compare your input with what’s expected.

...

Quick popups such as Quick documentation (via

span
classshortcut
Ctrl
+
span
classshortcut
Q
, or
span
classshortcut
Ctrl
+ J
span
classshortcut
Wiki Markup
{span:class=shortcut}Ctrl{span}
+
Wiki Markup
{span:class=shortcut}Q{span}
, or
Wiki Markup
{span:class=shortcut}Ctrl{span}
+
Wiki Markup
{span:class=shortcut}J{span}
for Mac) or Quick definition (via
span
classshortcut
Shift
+
span
classshortcut
Ctrl
+
span
classshortcut
I
, or
span
classshortcut
Shift
+
span
classshortcut
Cmd
+ I
span
classshortcut
Wiki Markup
{span:class=shortcut}Shift{span}
+
Wiki Markup
{span:class=shortcut}Ctrl{span}
+
Wiki Markup
{span:class=shortcut}I{span}
, or
Wiki Markup
{span:class=shortcut}Shift{span}
+
Wiki Markup
{span:class=shortcut}Cmd{span}
+
Wiki Markup
{span:class=shortcut}I{span}
for Mac) are available when you browse suggestions in code completion.

...

If you are fed up with some class constantly appearing in the suggestion list, IntelliJ IDEA can exclude this class or even a whole package so you never see it again. Just press

span
classshortcut
Alt
+ Enter
span
classshortcut
Wiki Markup
{span:class=shortcut}Alt{span}
+
Wiki Markup
{span:class=shortcut}Enter{span}
on an item and confirm the exclusion. You can always turn it back in
span
classshortcut
Settings
span
classshortcut
Editor
Auto Import
span
classshortcut
Wiki Markup
{span:class=shortcut}Settings{span}
Wiki Markup
{span:class=shortcut}Editor{span}
Wiki Markup
{span:class=shortcut}Auto Import{span}
.

10. Completion settings

If you want to change the default settings for completion you can do it via

span
classshortcut
Settings
span
classshortcut
Editor
Code Completion
span
classshortcut
Wiki Markup
{span:class=shortcut}Settings{span}
Wiki Markup
{span:class=shortcut}Editor{span}
Wiki Markup
{span:class=shortcut}Code Completion{span}
.

div
classnavigation
HTML Table
width100%
Table Row (tr)
Table Cell (td)
width33%
Align
alignleft
Previous
span
classsep
|
span
classtext
Editor Basics
Table Cell (td)
width33%
Align
aligncenter
Top
span
classsep
|
span
classtext
Quick Start
Table Cell (td)
width33%
Align
alignright
Next
span
classsep
|
span
classtext
Navigation Wiki Markup
{div:class=navigation}
{table:width=100%}
 {tr}
 {td:width=33%} {align:left}[Previous|Editor Basics] {span:class=sep}\| {span}{span:class=text}Editor Basics{span}{align}{td}
 {td:width=33%} {align:center}[Top|Quick Start] {span:class=sep}\| {span}{span:class=text}Quick Start{span}{align} {td}
 {td:width=33%} {align:right}[Next|Navigation] {span:class=sep}\| {span}{span:class=text}Navigation{span}{align} {td}
{tr}
{table}
{div}