Commands, tasks and the status bar

View source

Every command of the Actus extension, the Actus Commands view, the actus task type and its problem matcher, the status bar and Quick Actions, the new-project wizard, the Actus.toml schema and the snippets.

This page lists what the extension adds to the Command Palette, the Activity Bar, the task system and the status bar. The extension has no keyboard shortcuts and no context menus of its own.

The commands

Open the Command Palette and type Actus. These are the commands, with the title that VS Code shows.

Commands that run the compiler

These run the actus program in your workspace folder. They need a trusted workspace. Except for Actus: Show Compiler Version, they also need an Actus project: a folder that has an Actus.toml in its top level. Without one, they are disabled.

TitleRunsNotes
Actus: Newactus initOnly in an empty folder. It is the only command that needs no Actus.toml.
Actus: Checkactus check <file><file> is the active Actus file. See below.
Actus: Buildactus build <file>The same.
Actus: Runactus run <file>The same.
Actus: Testactus testThe whole project.
Actus: Apply Safe Fixesactus fix <file>Applies the fixes that the compiler marks as safe.
Actus: Formatactus fmt <file>Rewrites the file.
Actus: Format Checkactus fmt <file> --checkChanges nothing.
Actus: Watchactus watch --onceOne cycle of watch, not a running watcher.
Actus: Lockactus lock --checkChecks Actus.lock. It does not write it.
Actus: Conformance Checkactus conformance
Actus: Publish Packageactus publish
Actus: Show Compiler Versionactus versionNeeds no project.

<file> for check, build, run, fix, fmt and the format check is the file of the active editor when that is an Actus file on disk. If there is none, the command runs without a file, and check, build and run need a src/main.act. Otherwise they show Open an Actus source file or create src/main.act before running this command.

Each of these commands:

  1. clears the errors of the previous run in the Problems panel,
  2. shows the Actus Language Server channel of the Output panel without taking the focus, and writes the command and then its output there,
  3. puts every error[E####] at line:column that it finds in the output into the Problems panel,
  4. shows a short mark at the start of the first line of the active Actus file for two seconds.

The output looks like this. Paths and times are different on your computer:

text
$ /home/you/.actus/current/bin/actus check /home/you/hello/src/main.act
/home/you/hello/src/main.act: error[E1051] at 7:5: cannot mutate read-only binding `value`
For more information about an error, run `actus explain E1051`.
actus command exited with status 1 (23 ms)

The Problems panel then has one error, E1051: cannot mutate read-only binding value``, at line 7, column 5. It is one character wide.

The mark is ✓ Actus check succeeded, ✕ Actus check failed (with the name of the command) or ⚠ Actus formatting differs for a format check that finds a difference.

Other commands

TitleWhat it does
Actus: Show Ownership Chain GraphOpens the ownership panel.
Actus: Explain DiagnosticSee below.
Actus: Create New Project...The wizard.
Actus: Copy MCP Server ConfigSee below.
Actus: Quick ActionsOpens the menu of the status bar.
Actus: Install / Update ToolchainInstalls the compiler. See Overview and installation.
Actus: Check Toolchain VersionCompares your compiler with the newest release.
Actus: Execute CommandRuns one of the commands of the table above. It is hidden from the Command Palette. It takes the name of the command, such as check, as an argument, so it is for other extensions and for key bindings. Called without a valid name, it shows a list to pick from.

Actus: Explain Diagnostic takes the code from the diagnostic at the line of the cursor. If there is none, it asks you for a code such as E1140. It runs actus explain E1140 --format json, and if that fails actus explain E1140, and shows the text in a Markdown preview beside the editor. The same text opens from the quick fix Explain Actus E1140 on any diagnostic that has a code. See Fixing and explaining errors.

The Actus Commands view

The Actus icon in the Activity Bar opens a container with two views. Actus Commands is a grid of buttons, two in a row, for the commands that run the compiler. Each button has an icon, a name and a short line:

The Actus Commands view: a grid of buttons from Init and Check to Publish and Version, each with a short line under its name.
ButtonLineCommand
InitCreate project hereactus init
CheckValidate sourceactus check
BuildBuild an artifactactus build
RunBuild and run a programactus run
TestRun project testsactus test
FixApply safe diagnostic fixesactus fix
FormatFormat Actus sourcesactus fmt
Fmt CheckCheck only; do not modifyactus fmt --check
WatchRun one watch cycleactus watch --once
LockValidate the lockfileactus lock --check
ConformanceCheck source structure limitsactus conformance
PublishValidate & package archiveactus publish
VersionPrint compiler & LLVM versionactus version

The buttons run the same code as the palette commands. A button is disabled when the workspace is not trusted, when its command does not fit the folder (Init needs an empty folder; all others need an Actus.toml), when check, build or run have no Actus file and no src/main.act, and while another button is running. The running one reads Running Check....

The second view, Language Server, lists State, Target, Compiler and Detail of the server, as Overview and installation says.

Tasks

The extension adds a task type called actus. VS Code lists these tasks for every workspace folder in Terminal → Run Task..., under the names below. Each runs the program of the compiler directly, without a shell, in the folder.

Task nameRunsGroup
actus: checkactus checkbuild
actus: buildactus buildbuild
actus: runactus run
actus: testactus testtest
actus: fixactus fix
actus: fmt --checkactus fmt --check
actus: conformanceactus conformance
actus: lock --checkactus lock --check

The tasks of the groups build and test are the ones that Terminal → Run Build Task... (Ctrl+Shift+B) and Run Test Task... of VS Code offer. None of them is the default, so VS Code asks which one.

You can also write your own in .vscode/tasks.json. A task has these properties:

PropertyTypeWhat it does
commandone of check, build, run, test, fix, fmt, conformance, lockThe subcommand of actus. Required.
strictboolean, falseAdds --strict.
formathuman or jsonAdds --format human or --format json.
argslist of stringsMore arguments, added at the end. Empty strings are left out.

For build, run and test the extension adds --profile <profile> from actus.profile, unless args already has --release or --profile. The arguments come in this order: the command, --strict, --format, --profile, then the args. This file has a strict check as the default build task and a task that checks the formatting:

json
{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "actus: strict check",
      "type": "actus",
      "command": "check",
      "strict": true,
      "problemMatcher": "$actus",
      "group": { "kind": "build", "isDefault": true }
    },
    {
      "label": "actus: formatting",
      "type": "actus",
      "command": "fmt",
      "args": ["--check"],
      "problemMatcher": "$actus"
    }
  ]
}

The first task runs actus check --strict. The second runs actus fmt --check.

The $actus problem matcher

The matcher $actus reads the errors that the compiler prints and puts them in the Problems panel as links to the file. It matches a line of this form:

text
<file>: error[E####] at <line>:<column>: <message>

The word before the brackets may also be warning. The path is taken relative to the workspace folder, or as it is when it is absolute. The code, the line, the column and the message come from the line. The matcher is already set on the tasks that the extension provides; in your own tasks.json you name it, as above.

The compiler prints the line in this form for check, build and run. actus test puts error: in front of the line and a ./ before the path, as in error: ./tests/private.act: error[...]. The matcher accepts both forms and takes tests/private.act as the file.

The status bar

At the left of the status bar there is an item with the Actus icon:

text
$(actus-logo) Actus v0.3.0 · debug · host

It shows the version of the compiler, the build profile and the target, in the form Actus v<version> · <profile> · <target>. The icon is the Actus logo when the language server is ready, a spinning arrows icon while it starts, and a warning sign when it is not available. The tooltip has the state, the version, the profile, the target and the detail, and ends with Click for Actus quick actions.

The profile and the target come from the settings actus.profile and actus.target.

Quick Actions

A click on the item, or the command Actus: Quick Actions, opens a menu with six entries:

The Actus Quick Actions menu with its six entries, from Switch Build Profile to Restart Actus Language Server.
EntryLine under itWhat it does
Switch Build ProfileCurrent: debugAsks for debug or release, and sets actus.profile.
Switch Target TripleCurrent: hostAsks for a target and sets actus.target.
Show Ownership Chain GraphOpen bottom panel for active .act fileOpens the ownership panel.
Check / Update Actus ToolchainInstalled: v0.3.0The command Actus: Check Toolchain Version.
Copy Actus MCP Server ConfigJSON snippet for AI editorsThe command Actus: Copy MCP Server Config.
Restart Actus Language ServerStops the server and starts it again.

The list of targets is host, x86_64-unknown-linux-gnu, aarch64-apple-darwin, x86_64-pc-windows-msvc and thumbv7em-none-eabihf, and Custom target..., which asks you to type one. The new value is written to the settings of the workspace when a folder is open, and to your user settings otherwise. A change of a setting restarts the language server.

New project wizard

Actus: Create New Project... makes a project in four steps:

  1. A name. It must start with a letter and use only letters, digits, - and _.
  2. A runtime: std (hosted: file system, console, collections) or core (freestanding: embedded or bare metal).
  3. A parent folder, chosen in a dialog. The project is made in a new folder with the name, inside it.
  4. The extension runs actus new <name> --runtime <runtime> in the parent folder. When it succeeds, you can open the project in the current window or in a new one.

It is the same as actus new in a terminal. See Projects and modules.

MCP configuration

Actus: Copy MCP Server Config copies this JSON to the clipboard, with the path of the compiler that the extension uses, and offers Preview JSON:

json
{
  "mcpServers": {
    "actus": {
      "command": "/home/you/.actus/current/bin/actus",
      "args": ["mcp"]
    }
  }
}

Paste it into the configuration of an editor or an assistant that uses the Model Context Protocol. What the server offers is in Using Actus with AI assistants.

The Actus.toml schema

The extension contains a JSON Schema for the manifest, schemas/actus-manifest.schema.json, and registers it for files named Actus.toml in the tomlValidation of its manifest. The schema says:

  • [package] is required, with name (a letter first, then letters, digits, - and _) and version (such as 0.1.0). It also knows edition, entry, description and license.
  • [build] has runtime (std or core), profile (debug or release), backend (llvm or cranelift) and target.
  • [dependencies] has one entry for each module, as a version string or as a table with version or path.
  • [features] maps a name to a list of strings.

VS Code does not read this registration. The Even Better TOML extension does, and it checks Actus.toml with the schema. Without that extension you see no checks. The Actus extension does not check TOML itself. The compiler is the final judge: actus check reads Actus.toml.

Snippets

Type the prefix in an Actus file and accept the suggestion. Each snippet inserts a template with places to fill in.

PrefixNameInserts
verbVerb DeclarationA """ block and verb action(erg item: Int) { }.
testMeta Test VerbA """ block, meta test and verb test_behavior() -> Int { return 0; }.
structStruct DeclarationA """ block and a struct with one field field: Int,.
enumEnum DeclarationA """ block and an enum with VariantA and VariantB { value: Int }.
packPack Register DeclarationA """ block and a pack with erg storage: u32;, a layout of little or big, and a fields block with erg flag: u1 at 0; and abs _reserved: u31 at 1 = 0;.
caseCase Expressioncase abs value { Sample.Pattern => result, _ => fallback, }.
caseresCase Resultcase dat result with the arms Result.Ok(value) => value and Result.Err(_) => fallback.
caseoptCase Optioncase dat option with the arms Option.Some(value) => value and Option.None => fallback.
docDocumentation BlockAn empty """ block.

Each arm of the case snippets is a value, with the role written on the value that is matched. No arm has a return. The test snippet returns 0, which means the test passes, as in Testing. Replace the sample names and types with your own.

What you learned

  • The commands that run the compiler need a trusted workspace and an Actus.toml. They write to the Actus Language Server output channel and to the Problems panel.
  • The actus task type takes command, strict, format and args, and the matcher $actus turns errors into links.
  • The status bar item shows version, profile and target, and opens Quick Actions.
  • The wizard, the MCP helper, the schema and the snippets are small helpers. Look at the snippets before you rely on them.

Next: Settings reference.