Skip to content

Commit

Permalink
update readme for move-formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
robin committed May 1, 2024
1 parent 1860eec commit 4e037c2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 21 deletions.
56 changes: 36 additions & 20 deletions language/move-analyzer/editors/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,49 @@
# aptos-move-analyzer
**Table of Contents**
* [Introduction](#Introduction)
* [Installation](#Installation)
* [Features](#Features)
* [Installation](#Installation)
* [Support](#Support)


## Introduction <span id="Introduction">
The **aptos-move-analyzer** is a Visual Studio Code plugin for **Aptos Move** language developed by [MoveBit](https://movebit.xyz). Although this is an alpha release, it has many useful features, such as **highlight, autocomplete, go to definition/references**, and so on.

## Features <span id="Features">

Here are some of the features of the aptos-move-analyzer Visual Studio Code extension. To see them, open a
Move source file (a file with a `.move` file extension) and:

- See Move keywords and types highlighted in appropriate colors.
- As you type, Move keywords will appear as completion suggestions.
- If the opened Move source file is located within a buildable project (a `Move.toml` file can be
found in one of its parent directories), the following advanced features will also be available:
- compiler diagnostics
- aptos commands line tool(you need install Aptos Client CLI locally)
- aptos project template
- go to definition
- go to references
- type on hover
- inlay hints
- linter for move file
- formatter for move file
- ...

### Mandatory reading, regarding the use of formatting
1. After installing this vscode plugin, you still need to install the latest language server by following the method described in the subsequent section 1.B, which essentially boils down to one command:
```
cargo install --git https://github.com/movebit/move --branch aptos-move-analyzer aptos-move-analyzer
```

2. Once both the language server and the aptos-move-analyzer plugin from the vscode plugin marketplace are installed, the formatting feature is not enabled by default. You will need to enable the corresponding feature in the settings(Preferences > Settings*. Search for the `aptos-move-analyzer` setting).


3. To format a .move file, simply open it and right-click to select '**Format Document**' for a one-click formatting.


4. If you wish to study or raise an issue regarding the formatting feature, you can visit the repository at https://github.com/movebit/movefmt/tree/develop.


## Installation <span id="Installation">

**Note**:
Expand Down Expand Up @@ -118,25 +153,6 @@ In addition, if you have already opened the move project before, the installed p

When you first open a project, there will be some dependencies (configured in Move.toml) that need to be downloaded, so you need to run `aptos move compile` command first to build the project. During the build process, the dependencies will be downloaded. Once all the dependencies for the project have been downloaded, aptos-move-analyzer can properly parse the dependencies and project source code.

## Features <span id="Features">

Here are some of the features of the aptos-move-analyzer Visual Studio Code extension. To see them, open a
Move source file (a file with a `.move` file extension) and:

- See Move keywords and types highlighted in appropriate colors.
- As you type, Move keywords will appear as completion suggestions.
- If the opened Move source file is located within a buildable project (a `Move.toml` file can be
found in one of its parent directories), the following advanced features will also be available:
- compiler diagnostics
- aptos commands line tool(you need install Aptos Client CLI locally)
- aptos project template
- go to definition
- go to references
- type on hover
- inlay hints
- linter for move file
- ...

## Support <span id="Support">

1.If you find any issues, please report a GitHub issue to the [movebit/move-analyzer-issue](https://github.com/movebit/move-analyzer-issue) repository to get help.
Expand Down
2 changes: 1 addition & 1 deletion language/move-analyzer/editors/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"publisher": "MoveBit",
"icon": "images/move.png",
"license": "Apache-2.0",
"version": "0.4.0",
"version": "0.5.0",
"preview": true,
"homepage": "https://github.com/move-language/move",
"repository": {
Expand Down

0 comments on commit 4e037c2

Please sign in to comment.