Code Editor

Syntax Highlighting

After opening an sCrypt file, you can see the highlighting effect of certain syntax elements. For example, keywords (such as loop require) use one color, and types (such as int and bytes) use another color.

_images/highlighting.png

Hover

When moving the mouse and hovering over a symbol, the relevant information of the symbol will be automatically displayed.

_images/hover.gif

Autocomplete

When you enter the code on the editor, IDE will automatically prompt according to your input.

_images/completion.gif

Function Signature Help

After entering the function name, IDE will automatically give relevant prompts about the function signature based on your input.

_images/signature_help.gif

Errors and Warnings

When you are editing code, you may see wavy underlines in different colors: red indicate errors, and yellow warnings. You can quickly identify the problem according to the error message. The error messages of all files are gathered in the PROBLEMS panel. Once errors are fixed, error messages in the PROBLEMS panel will disappear.

_images/diagnostic.png

Code Navigation

Rename Symbol

Rename identifiers/symbols in batch, such as contract name, contract properties, local variables, functions, and types.

Place the text cursor on the code symbol to be renamed,

Keyboard: press F2

Mouse: Right click on the code and select Rename Symbol .

_images/renameSymbol.gif

Formatting

Open the code you want to format,

Keyboard: Press Shift + Alt + F

Mouse: Right-click the code and select “Format Document”.

_images/formatting.gif

After formatting, if you find that a line of code is too long, you can try to manually break the line and format it. “Format Document” will retain your line-breaking information.

Note

Before formatting, you need to make sure that the code has no syntax errors and can be compiled normally

Highlight unused variables

IDE use tilde to mark variables declared but not referenced

_images/unused.png