Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/build-and-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ every test.
| `run` | runs `main` in the project. |
| `test` | runs all tests in the project. |
| `doc` | generates API documentation for the project. |
| `format` | formats the source code of the project. |
| `stat` | prints statistics about the project. |
| `build` | compiles the entire project. |
| `build-classes` | compiles the project to Java class files. |
Expand Down
24 changes: 24 additions & 0 deletions src/checking-running-and-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,30 @@ build

We read it by opening `build/doc/index.html` in a browser.

## Formatting the Source Code

We can format the source code of the project with the `format` command. The
command rewrites every file in `src` and `test` in place. If `src/Main.flix` reads:

```flix
def main( ) : Unit \ IO =
println( "Hello World!" )

def add(x:Int32,y:Int32):Int32=x+y
```

then after `format` it reads:

```flix
def main(): Unit \ IO =
println("Hello World!")

def add(x: Int32, y: Int32): Int32 = x + y
```

If the project does not compile, `format` reports the errors and leaves the
files untouched.

## Printing Statistics

We can print statistics about the project with the `stat` command:
Expand Down
3 changes: 3 additions & 0 deletions src/vscode.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ Flix also comes with an (optional) Visual Studio Code color theme called "Flixif
- Rename local variables or formal parameters.
- Rename functions.

* __Formatting__
- Format the current file.

* __Code Lenses__
- Run `main` from within the editor.
- Run tests from within the editor.
Expand Down
Loading