DEV Community

ZHZL-m
ZHZL-m

Posted on

【Journey of HarmonyOS Next】DevEco Studio User Guide (9)

Image description

1 -> Code Structure Tree

Use the shortcut keys Alt+7/Ctrl+F12 (Command+7 for macOS) to open the code structure tree, quickly view the structure tree of the file code, including global variables and functions, class member variables and methods, etc., and jump to the corresponding line of code.

Image description

2-> Code reference lookup
The Find Usages code reference lookup function helps us quickly see where an object (variable, function, or class, etc.) is referenced, which can be used for subsequent code refactoring, which can greatly improve development efficiency.

How to use: On the object you want to find, right-click > Find Usages or use the shortcut Alt + F7 (Option + F7 for macOS). Clickable

Image description

icon to view the variable assignment location, click it

Image description

icon to view variable references.

Image description

3 -> Function comment generation

DevEco Studio allows you to quickly generate annotations at the point where a function is defined. Before the code block defined by the function, enter "/**" + enter key to quickly generate comment information.

illustrate

C++ files also support the use of "//!" + Enter key to quickly generate comments.

Image description

4 -> code lookup

Find code with instant navigation of symbols, classes, or files. Inspect the call or type hierarchy to easily search for everything in your project. By clicking the Shift shortcut twice in a row, the code search interface is opened, and the search results are displayed in real time in the lower window. Double-click the result of the search to quickly open the location of the file it is in.

Image description

5 -> Quickly check the API interface and component reference documents

When you call ArkTS/JS APIs or components in the editor, you can quickly and accurately retrieve the corresponding reference documents in the editor.

Click Show in API Reference in the lower right corner of the pop-up window, or select the interface or component and right-click Show in API Reference to quickly view more detailed API documentation.

illustrate

DevEco Studio integrates with the offline version of the API reference class documentation.

Image description

In the pop-up window, you can view:

Whether the API used involves permission requests or can only be used within the testing framework.
The status of the interface used. The deprecated tag indicates the API interface that is about to be deprecated, and can be replaced by the API marked with useinstead, please pay attention to it when developing.

Top comments (0)