You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VS Code Java is backed by a full Java language server and it understands Java code. Because of that, you get features like Code Navigation, IntelliSense, Refactoring, etc. This is important when your projects get bigger and more complex. Now let's further look at the code editing experience.
29
+
</p>
30
+
<blockquoteclassName="card-body">
31
+
<h5className="font-weight-light">Basic Editing User Guide</h5>
32
+
<pclassName="mb-0">
33
+
To make the most of VS Code, we strongly recommend reading the <ahref="https://code.visualstudio.com/docs/editor/codebasics">Basic Editing</a> user guide. You'll get to know cool tricks about multi-select, formatting, indentation, folding, and much more.
<DataCellclassName="font-weight-bold"gridColumn="1">Go to Definition</DataCell>
44
+
<DataCellgridColumn="2"><kbd>F12</kbd><br/>You can also hover on the symbol to preview its declaration and javadoc. To jump to the definition, hold the {controlKey} key, and click on the symbol.</DataCell>
45
+
</DataRow>
46
+
<DataRowkey={2}>
47
+
<DataCellclassName="font-weight-bold"gridColumn="1">Go to Implementation</DataCell>
48
+
<DataCellgridColumn="2">{f12Key}<br/>For an interface, this shows all the implementors of that interface and for abstract methods, this shows all concrete implementations of that method.</DataCell>
49
+
</DataRow>
50
+
<DataRowkey={3}>
51
+
<DataCellclassName="font-weight-bold"gridColumn="1">Go to Type Definition</DataCell>
52
+
<DataCellgridColumn="2">This one allows you to go to the definition of the type of the symbol. For example, you have a class member <code>someString</code>, "Go to Definition" will take you to the definition of <code>someString</code> while "Go to <strong>Type</strong> Definition" will take you to the definition of <code>String</code>.</DataCell>
53
+
</DataRow>
54
+
<DataRowkey={4}>
55
+
<DataCellclassName="font-weight-bold"gridColumn="1">Find All References</DataCell>
56
+
<DataCellgridColumn="2">{shiftAltF12}<br/>This allows you to quickly analyze the impact of your edit or the popularity of your specific method or property throughout your repository.</DataCell>
57
+
</DataRow>
58
+
</DataGrid>
59
+
</div>
60
+
<div>
61
+
<p>
62
+
The commands above will possibly take you to another file. But you can choose to stay using the peeking features below:
IntelliSense is a general term for a variety of code editing features including: code completion, parameter info, quick info, and member lists. IntelliSense features are sometimes called by other names such as "code completion", "content assist", and "code hinting."
87
+
</p>
88
+
<p>
89
+
IntelliSense works as you type. For example, when you try to invoke some member of an object, a list of all the members is popped up for you to choose from. If you continue typing characters, the list of members (variables, methods, etc.) is filtered to only include members containing your typed characters. Pressing <kbd>Tab</kbd> or <kbd>Enter</kbd> will insert the selected member.
In most cases, IntelliSense is triggered automatically. You can also press {ctrlSpace} to do it manually. For example, when you're trying to invoke a member function and want to see the parameter info, this will do the magic.
95
+
</p>
96
+
</blockquote>
97
+
<h2className="font-weight-light">Refactoring</h2>
98
+
<p>
99
+
VS Code Java provides essential refactoring features and makes it productive to modify larger codebase. The most frequently used one is <strong>Rename</strong>. It's so popular that a dedicated hot key <kbd>F2</kbd> is assigned to it. When you rename a symbol, all its references are also renamed.
100
+
</p>
101
+
<p>
102
+
There are more refactoring features like <strong>Extract</strong>, <strong>Inline</strong>, etc. The availability changes corresponding to the current cursor position. All available features are packed in to the <strong>Refactor</strong> context menu. And you can also pop the list by pressing {ctrlShiftR}
103
+
</p>
104
+
<p>
105
+
You may also notice the lightbulb near the cursor. It indicates that some <strong>Code Actions</strong> are available. In VS Code, Code Actions can provide both refactorings and Quick Fixes for detected issues. To show the full list of available actions, click the lightbulb or press {ctrlDot}
There are other code actions that are not limited to the cursor position. They are grouped into the <strong>Source Action</strong> context menu. Here's a list of them.
0 commit comments