Skip to content

Latest commit

 

History

History
59 lines (28 loc) · 1.55 KB

File metadata and controls

59 lines (28 loc) · 1.55 KB

Code suggestions (with fixes)

Note

See aptos-language-server diagnostics command (https://github.com/aptos-labs/move-vscode-extension/blob/main/docs/configuration.md#additional-commands) on how to apply quickfixes from the CLI.

Use method call notation

Code: replace-with-method-call

replace_with_method_call

Use compound assignment expression

Code: replace-with-compound-expr

compound_expr

Use vector index expr

Code: replace-with-index-expr

Detects expressions of form *vector::borrow(&some_vector, index) and *some_vector.borrow(index), which can be converted to some_vector[index].

vector_index_expr

Use field initialization shorthand

Code: use-struct-lit-field-shorthand, use-struct-pat-field-shorthand, use-schema-lit-field-shorthand

Detects struct literal fields which could be written in shorthand form.

field_shorthand

Redundant integer type cast

Code: remove-redundant-cast

Detects expressions like number as u8, where number is already of type it's being casted to.

redundant_cast

Add _ prefix to the variable name

Code: rename-with-underscore-prefix

Prefixes unused variable with _.

rename_fix.gif