Problems with IntelliJ IDEA code hints

1. When writing code, use Alt-Insert (Code|Generate...) to create getter and setter methods for any field in the class.

2. A special variable in the CodeCompletion property is that activating Ctrl-Alt-Space can complete class names in or not in the current file. The import flag is automatically created if the class is not imported.

3. Use the Ctrl-Shift-V shortcut to insert the most recently used clipboard content selection into the text. When using, the system will pop up a dialog box containing clipping content, from which you can select the part you want to paste.

4. Use the CodeCompletion (code completion) property to quickly complete various statements in the code by typing the first few letters of a class name and then using Ctrl-Space to complete the full name. If there are multiple options, they are listed in the cheat list.

5. Use Ctrl-/ and Ctrl-Shift-/ to comment/uncomment lines and blocks of code.

6. -/Use a single-line comment marker ("//...") to comment/uncomment the current line or select a block of code. Ctrl-Shift-/, on the other hand, encloses the selected block with block comment markers (“/*…*/”). To uncomment a block of code just press Ctrl-Shift-/ anywhere in the block.

7. Press Alt-Q (View|Context Info) to view the declaration of the current method without moving the code. Press twice in succession to display the currently edited class name.


8. In the editor, Ctrl-D can copy the selected block or the current line without the selected block, and Ctrl-Y is the opposite.

9. The function of Ctrl-W (select word) in the editor is to first select the word at the caret, and then select the extension area of ​​the source code. For example, choose a method name, then the expression that calls the method, then the entire statement, then the containing block, and so on.

10. Use the Escape key in any tool window to move the focus to the editor.

Shift-Escape not only moves the focus to the editor but also hides the current (or last active) tool window.

The F12 key moves the focus from the editor to the most recently used tool window.

11. An easy way to see the value of any expression while debugging a program is to select the text in the editor (you can do this more efficiently by pressing Ctrl-W a few times) and then press Alt-F8.

12. To open the browser for the Java documentation of the class or method used at the editor's caret, press Shift-F1 (External JavaDoc in the right-click menu).

To use this feature, you need to add the path to the browser, set it in the "General" option (Options | IDE Settings), and add the created Java document to the project (File | Project Properties).

13. With the Ctrl-F12 (View | File Structure Popup) keys you can quickly navigate in the currently edited file.

At this point it will display a list of members of the current class. Highlight an element to navigate and press Enter or F4. To easily navigate to an entry in the list, just type its name.

14. Put the cursor on the marker or its checkpoint in the code and press Alt-F7 (Find Usages... in the right-click menu) to quickly find a class, method or variable used in the entire project s position.

15. Press Ctrl-N (Go to | Class…) and then type the name of the class to quickly open any class in the editor. Select the class from the drop-down list that appears.

 

In the same way you can open non-Java files in a project by using Ctrl-Shift-N (Go to | File…).

16. To navigate the declarations of classes, methods, or variables used in some places in the code, place the cursor on the view item and press Ctrl-B. You can also navigate to the declaration by pressing the Ctrl key and clicking the mouse button on the viewing point.

17. Put the cursor on the view point and press Ctrl-Alt-B to navigate to the implementation code of an abstract method.

18. To see the inheritance hierarchy of a selected class, press Ctrl-H (Browse Type Hierarchy). You can also activate the inheritance relationship view in the editor to view the inheritance relationship of the currently edited class.

19. Use Ctrl-Shift-F7 (Search | Highlight Usages in File) to quickly highlight the usage of a variable in the current file. Press Escape to clear the highlight.

20. Use Alt-F3 (Search | Incremental Search) to implement quick search function in the editor.

Enter characters in the "Search for:" tooltip and use the arrow keys to search forward and backward. Press Escape to exit.

21. Press Ctrl-J to execute some Live Template abbreviations you can't remember. For example, key "it" and then press Ctrl-J to see what happens.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326528658&siteId=291194637