Reference › Language reference › The VS Code extension

Reference › Language reference

The VS Code extension

Every command, view, setting and walkthrough step of the VS Code extension, as its manifest (vscode/package.json) declares them. How to use them is in The VS Code extension.

Commands#

The extension has 108 commands, all in the category arche-lang: the palette (Ctrl+Shift+P, or ⇧⌘P on a Mac) shows arche-lang: Build Project. The palette shows a command only where it applies. Each table says when, where else the command is, and its key. The id in brackets is the one a key binding names.

Always in the palette#

These are in the palette whenever the extension runs, some only on the desktop or only in a browser.

Command In the palette Also in Key
Add Board to Model… (arche.boards.add) always the Store view's title bar; the Store view's items
Build Project (arche.build) always the editor title bar; the Model view's title bar; the editor's right-click menu › arche-lang
Explain Diagnostic Code… (arche.explainDiagnostic) always
Generate Code… (arche.generateCode) always
Get Started with arche-lang (arche.walkthrough) always the Model view when it is empty
Import from Polarion… (arche.importPolarion) on the desktop
Import Frontend Repository… (arche.importFrontend) on the desktop
New Project… (arche.new) always the Model view when it is empty; the Requirements & Proof view when it is empty; the Environment view when it is empty
Open archec Terminal (arche.openTerminal) on the desktop
Open Diagram to the Side (arche.openDiagram) always the editor title bar; the Model view's title bar; the Model view's items; the editor's right-click menu › arche-lang Ctrl+K V (Mac: Cmd+K V)
Open Example… (arche.openExample) on the desktop the Model view when it is empty
Open System in Arche App (arche.openApp) on the desktop the editor title bar; the Model view's title bar; the Model view's items
Refresh Generated Code (arche.generated.refresh) always the Generated Code view's title bar
Restart Language Server (arche.restartServer) always
Resync with Polarion (arche.polarion.resync) on the desktop the editor's right-click menu › arche-lang
Run Tests (arche.runTests) always the Model view's title bar; the Requirements & Proof view's title bar
Search Store… (arche.store.search) on the desktop the Store view's title bar
Select Model to Browse… (arche.selectEntry) always the Model view's title bar; the Model view when it is empty
Set Up Development Environment… (arche.env.setup) on the desktop the Environment view's title bar
Show Cheat Sheet (arche.showCheatSheet) always the Requirements & Proof view when it is empty
Show Pattern Reference (arche.showPatterns) always the Documentation view when it is empty
Show Requirement Status (arche.status.show) always
Simulate (arche.sim.run) always the editor title bar; the editor's right-click menu › arche-lang
Sync with Polarion… (arche.polarion.sync) on the desktop the Documentation view's title bar
What the Desktop Adds… (arche.web.desktopAdds) in a browser

In the palette when they apply#

These show once the model uses what they act on, or when the cursor is on what they act on.

Command In the palette Also in Key
Check Board's Build from Trace… (arche.status.build) the model has a board, on the desktop the Requirements & Proof view's title bar
Export Document as Word… (arche.docs.exportWord) a document is open, on the desktop the editor title bar; the Documentation view's items
Export LaTeX Specification… (arche.exportLatex) a model is open and (at the expert level or the model has a deliverable) the editor's right-click menu › arche-lang
Export Project as HTML… (arche.exportSite) a model is open, on the desktop the Model view's title bar; the editor's right-click menu › arche-lang
Extract to Component Library… (arche.library.extract) in a .arche file and the cursor is on a component the Model view's items; the editor's right-click menu › arche-lang
Forget the Polarion Token (arche.polarionForgetToken) the model has a Polarion source, on the desktop
Generate Database Schema… (arche.database.generate) the model has a database
Generate Frontend Code (arche.generateFrontend) the model has a ui, on the desktop
Go to Model Element (arche.gotoModelElement) in a .c, .h, .cc, .cpp, .hpp, .rs or .go file the editor's right-click menu
Go to Simulator Error… (arche.whereError) the model has a built project, on the desktop
Insert Animation from Template… (arche.animation.insert) at the expert level or the model has an animation the Animations view's title bar
Insert Figure… (arche.polarion.insertFigure) in a .arche file and the model has a Polarion source, on the desktop the editor's right-click menu › arche-lang
Move Definition to a File… (arche.moveDefinition) in a .arche file and the cursor is on a definition a panel's right-click menu; the editor's right-click menu › arche-lang
Open TypeScript Block as File (arche.openTsBlock) in a .arche file and the cursor is on a TypeScript block the editor's right-click menu › arche-lang
Preview Animation (arche.animation.preview) the model has an animation
Preview Generated Changes… (arche.previewGenerated) the model has generated code
Preview Requirement (arche.polarion.previewRequirement) in a .arche file and the model has a Polarion source, on the desktop the editor's right-click menu › arche-lang
Prove a Fix Against a Git Ref… (arche.test.against) the model has test plans, on the desktop the Requirements & Proof view's title bar
Pull Code Changes (arche.pull) the model has a built project, on the desktop the Model view's title bar
Run FPGA Tests in GHDL (arche.test.vhdl) the model has FPGA components, on the desktop
Run Test Ladder… (arche.test.ladder) the model has a board, on the desktop the Requirements & Proof view's title bar
Run Tests on a GPU (arche.test.gpu) the model has gpu, on the desktop
Show CAD in 3D (arche.cad.show) the model has CAD parts, on the desktop
Show Database Layout (arche.database.show) the model has a database
Show Generated Code (arche.showGeneratedCode) in a .arche file and the model has generated code the Model view's items; the editor's right-click menu › arche-lang
Show in 3D (arche.scene3d.show) the model has 3D bodies
Show Next Step (arche.nextStep) a model is open and below the expert level the Requirements & Proof view when it is empty
Start Live (arche.live.start) (at the expert level or the model has a deployment) and Live is not running, on the desktop the Live view's title bar; the Live view when it is empty
Stop Arche App (arche.stopApp) the Arche app is running, on the desktop
Stop Live (arche.live.stop) Live is running, on the desktop the Live view's title bar
Synthesise FPGA Design (arche.synth) the model has FPGA components, on the desktop
Toggle Dimmed Translations (arche.translations.toggleDim) in a .arche file and the model has translations
UI Preview (arche.ui.preview) the model has a ui the editor title bar
Validate Project Folder… (arche.validateProject) at the expert level the Explorer's right-click menu
Why Did This Happen? (arche.why) in an arche-lang debug session the debug toolbar; the Call Stack's right-click menu
Why Did This Not Happen? (arche.whyNot) in a .arche file and the cursor is on a component the editor's right-click menu › arche-lang
Write Database Migration… (arche.database.migrate) the model has a database

Not in the palette#

These are buttons and menu items of a view, a panel or the editor, shown where they act.

Command Where Key
Add Board Collection… (arche.boards.addCollection) the Store view's title bar; the Store view when it is empty
Add Component from Folder… (arche.library.add) the Model view's title bar
Add Device to Model… (arche.devices.add) the Store view's items
Add Function… (arche.item.addFunction) the Model view's items
Add Part… (arche.item.addPart) the Model view's items
Add Port… (arche.item.addPort) the Model view's items
Add State… (arche.item.addState) the Model view's items
Add to Project (arche.store.add) the Store view's items
Add to This Project (arche.shelf.add) the Store view's items
Audit Code Origins (arche.store.audit) the Store view's title bar; the Store view's items
Check Board Collection (arche.boards.check) the Store view's items
Clear Shelf Filter (arche.boards.clearFilter) the Store view's title bar
Copy Fix Command (arche.env.copyFix) the Environment view's items
Delete (arche.item.delete) the Model view's items
Duplicate to My Collection… (arche.boards.duplicate) the Store view's items
Explain & Fix with Claude (arche.live.explain) the Live view's items
Filter Shelves… (arche.boards.filter) the Store view's title bar
Go to Model Element (arche.generated.gotoModel) the Generated Code view's items
Install Tool… (arche.env.install) the Environment view's items
New Board… (arche.boards.new) the Store view's title bar; the Store view's items
Open Board Definition (arche.boards.open) the Store view's items
Open Document (arche.docs.open) the Documentation view's items
Open in Arche (arche.docs.openInArche) the editor title bar; the Documentation view's title bar; the Documentation view's items
Open in Arche (arche.openInArche) only the extension runs it: a click on an item, a link or a code lens
Open the Generated Code (arche.generated.open) only the extension runs it: a click on an item, a link or a code lens
Refresh Documents (arche.docs.refresh) the Documentation view's title bar
Refresh Environment (arche.env.refresh) the Environment view's title bar; the Environment view when it is empty
Refresh Model (arche.refreshModel) the Model view's title bar
Refresh Shelves (arche.boards.refresh) the Store view's title bar; the Store view when it is empty
Refresh Store (arche.store.refresh) the Store view's title bar
Rename… (arche.item.rename) the Model view's items
Reveal Collection Folder (arche.boards.reveal) the Store view's items
Reveal Deliverable in Source (arche.docs.reveal) the editor title bar; the Documentation view's items
Reveal in Source (arche.revealItem) only the extension runs it: a click on an item, a link or a code lens
Run Doctor in Terminal (arche.env.doctor) the Environment view's title bar
Run Test Plan or Case (arche.tests.run) only the extension runs it: a click on an item, a link or a code lens
Save as Board in My Collection… (arche.boards.extract) the Model view's items
Set Kind… (arche.item.kind) the Model view's items
Set Name… (arche.item.label) the Model view's items
Show Board Details (arche.boards.show) the Store view's items
Show Card (arche.shelf.show) the Store view's items
Show Card (arche.store.show) the Store view's items
Show in Source (arche.proof.reveal) the Requirements & Proof view's items
Show Status Report (arche.status.report) the Requirements & Proof view's title bar
Simulate the Built Project (arche.runSimulation) only the extension runs it: a click on an item, a link or a code lens
Use as Starting Point (arche.store.startFrom) the Store view's items

Views#

The arche-lang icon in the activity bar opens a side bar with 9 views, in this order.

Model#

Id arche.model. Always shown. Its title bar: Open System in Arche App, Open Diagram to the Side, Build Project, Select Model to Browse…, Refresh Model, Run Tests, Pull Code Changes, Export Project as HTML…, Add Component from Folder…. On its items: Open System in Arche App, Open Diagram to the Side, Add Part…, Add Port…, Add Function…, Add State…, Rename…, Set Name…, Set Kind…, Delete, Extract to Component Library…, Save as Board in My Collection…, Show Generated Code.

When it is empty, it says:

No arche-lang model in this folder yet.

New Project…

Get Started

Open Example…

A model already here? Select the model file.

Requirements & Proof#

Id arche.proof. Always shown. Its title bar: Run Tests, Show Status Report, Run Test Ladder…, Prove a Fix Against a Git Ref…, Check Board's Build from Trace…. On its items: Show in Source.

When it is empty and no model is open, it says:

The requirements of the model show here, each with what proves it: ✓ proven, ✗ failing, ○ not proven yet.

New Project…

When it is empty and a model is open, it says:

No requirement yet. A requirement says what the system shall do; a test case that verifies it proves it.

Show Next Step

Show the Cheat Sheet

Files#

Id arche.files. Always shown. It starts collapsed.

Generated Code#

Id arche.generated. Shown on the desktop. It starts collapsed. Its title bar: Refresh Generated Code. On its items: Go to Model Element.

Store#

Id arche.boards. Always shown. It starts collapsed. Its title bar: Add Board to Model…, Filter Shelves…, Clear Shelf Filter, Refresh Shelves, New Board…, Add Board Collection…, Search Store…, Audit Code Origins, Refresh Store. On its items: Add Board to Model…, Show Board Details, Open Board Definition, Duplicate to My Collection…, New Board…, Check Board Collection, Reveal Collection Folder, Add to Project, Show Card, Use as Starting Point, Audit Code Origins, Add Device to Model…, Add to This Project.

When it is empty, it says:

Reading the shelves of the store archec ships… They show here when they are read, and the view tries again by itself.

Refresh Now

Your own boards: Add Board Collection…

Environment#

Id arche.env. Shown on the desktop. It starts collapsed. Its title bar: Set Up Development Environment…, Run Doctor in Terminal, Refresh Environment. On its items: Install Tool…, Copy Fix Command.

When it is empty and no tools are read yet, it says:

The tools a project needs to be built and tested, from its model: open a folder with an Arche project.

New Project…

When it is empty and the tools are being read, it says:

Looking up the project's tools on this computer…

When it is empty and the tools could not be read, it says:

The project's tools could not be read: fix the errors of its model, then refresh.

Refresh

Documentation#

Id arche.docs. Shown (at the expert level or the model has a deliverable), on the desktop. Its title bar: Sync with Polarion…, Refresh Documents, Open in Arche. On its items: Export Document as Word…, Reveal Deliverable in Source, Open Document, Open in Arche.

When it is empty, it says:

No documents yet.

Declare a deliverable in the model (deliverable SRS "Software Requirements" { group "Software" }) and name it from a requirement (document SRS).

Show pattern reference

Live#

Id arche.live. Shown (at the expert level or the model has a deployment), on the desktop. Its title bar: Start Live, Stop Live. On its items: Explain & Fix with Claude.

When it is empty, it says:

Watch a deployment while it runs, or replay its traces: each requirement, chain, thread and container passing or failing, on its line of the model.

Start Live

Animations#

Id arche.animations. Shown at the expert level or the model has an animation. It starts collapsed. Its title bar: Insert Animation from Template….

Settings#

The Settings editor shows them in 7 groups, under Extensions › arche-lang.

Editor#

Setting Default What it does
arche.level auto How the editor speaks: beginner says the common diagnostics in plain words and lists what exists ("You used bar but b has no port called that. Its ports are: cmd, st."), and offers only the core of the language in completion when the project does not set its level. auto is beginner for a new model and expert once the project says level full or uses advanced declarations; it also decides which side bar views show. A project's level simple / level full wins for completion. auto: Beginner until the project says level full, or (saying no level) already uses declarations beyond the simple set: deployments, safety, the Arche app… beginner: Diagnostics in plain words, with what exists; completion offers the core of the language (unless the project says level full). expert: The full messages and the whole language (unless the project says level simple).
arche.suggestions auto Quiet hints of what the store's shelves already have: a function that looks like a PID or a debounce, a message whose fields are a Vec3 or a GeoPoint, a component named as a store device. Shown as hints (shelf-suggest), never as warnings; the quick fix adds the uses and the include, and replaces the declaration when it is safe. archec suggest lists them all. auto: On at the beginner level (arche.level, the project's level simple), off otherwise. on: Always shown. off: Never shown.
arche.lint.minimumSeverity hint Lowest severity shown in the Problems view. One of error, warning, info, hint.
arche.inlayHints.enabled true Show inlay hints: a sum of quantities folded to one value, a rate as its period, a constant's value where it is used, what a definition inherits, a budget's roll-up against its limit, a thread's response time against its deadline, the copies of a part array.
arche.format.indent unset Spaces per indentation level when a file is formatted. Unset, the editor's tab size for arche-lang (2).
arche.translations.dim true Show the translations written inline ("Démarrage" en "Start") dimmed, so the model reads in its source language. Translations kept in a translations en { … } file show on hover instead. Toggle Dimmed Translations switches it.
arche.bodies.highlight false A faint background behind each ```arche body, so the code stands out from the declarations around it.
arche.embedded.problems false Show the errors of the models written in JavaScript and TypeScript (archeSrc`…` , as the tests write them) in the Problems view. Off by default: a test's model may be wrong on purpose.
arche.editorStubs project Where the extension writes what Python and TypeScript tooling need to know Arche's names in a model's code files (code "file.py", code "file.ts"): Arche's helpers (wait, send, goto…) and the model's messages, components and constants. project keeps them in .arche/typings beside the main file — .arche/typings/<name> for an entry not called main.arche — where Pylance and the TypeScript server find them with no settings of yours. Only a file archec wrote is overwritten or removed. project: In .arche/typings, one place per project: a typed arche package for Python, arche.d.ts for TypeScript. Nothing is written beside the code. beside: Beside the code, as earlier versions did: arche.py in each folder of .py files, arche.d.ts and a tsconfig.json in each folder of .ts files. off: Nothing is written.
arche.python.stubs true Deprecated. Use arche.editorStubs: off writes nothing, beside writes arche.py and arche.d.ts beside the code as before. false here still means off.

Diagram#

Setting Default What it does
arche.diagram.theme vscode Colours of the diagram, the simulator and the chronogram. vscode: The VS Code theme's colours, high contrast included. auto: Arche's own canvas, light or dark after the VS Code theme. light: Arche's light canvas. dark: Arche's dark canvas.
arche.diagram.positions source Where dragging a block writes its place. A view (a viewpoint with include lines) always writes to main.layout.json: it has no place in the source. source: In the .arche source: the block's canvas line, else its at. file: In main.layout.json beside the main file, out of the model.

Project & Build#

Setting Default What it does
arche.entry empty Entry .arche file of the workspace (relative path). Empty: the file being edited, or the file that includes it.
arche.outputDirectory arche-out Where Build Project writes the generated project, relative to the workspace folder (or absolute). Left as is in a workspace with several projects, each builds into its own sub-folder (arche-out/).
arche.buildOnSave false Rebuild the Arche project every time a .arche file is saved.
arche.pullOnChange ask Code edited in the Arche app (in the generated project): bring it back into the Python defs and the code blocks it came from. ask: Offer to pull when the Arche app saves code changes to the generated project. always: Pull them without asking. never: Only pull with Pull Code Changes.

Live#

Setting Default What it does
arche.live.offerOnOpen false Offer to start archec live when this folder opens (once). archec new --kind sets it in the project's .vscode/settings.json.

Store & Boards#

Setting Default What it does
arche.store empty The Arche Store the Store view shows and Add to Project takes from: a folder, a git URL (cloned into ~/.arche/indexes), or a hosted store's https URL. Empty: ARCHE_STORE, else what archec store use set, else the hosted store https://store.arche-lang.xyz.
arche.boardCollections none Folders of your own boards (each a collection: a library.arche and boards/<id>/<id>.arche), shown in the Store view beside the store archec ships (arche-hw-store). ~ is your home folder; a relative path is from the first workspace folder. archec and the language server see them as ARCHE_BOARDS.

Arche App#

Setting Default What it does
arche.app.openIn browser Where Open System in Arche App opens the app: your browser, or a tab of VS Code (Simple Browser). One of browser, editor.
arche.app.port 0 The port of the built-in Arche app that Open System in Arche App serves on 127.0.0.1. 0 picks a free one. The separate arche program uses arche.port.
arche.app.allowPython false Let the Arche app run the project's Python in this machine's interpreter (with your privileges).
arche.app.allowBuild false Let the Arche app's Code page build the source and run language servers (cargo, clangd…, with your privileges).
arche.port 8888 The port of the separate Arche program (arche --project, see arche.paths.app) that Open in Arche starts in a terminal. The built-in app of Open System in Arche App uses arche.app.port.

Paths#

Setting Default What it does
arche.paths.app empty The Arche app (its binary, e.g. …/dist/arche-darwin-arm64), which Open in Arche starts with --project. Empty: arche on the PATH. Replaces arche.executablePath, still read when this is empty.
arche.paths.appCli empty The Arche app's command line (arche-cli.mjs, with its Python runtime) that the Documentation view, Run Tests, Run Simulation and the simulation debugger run. Empty: an Arche checkout beside the workspace, arche-cli on the PATH, else the copy bundled with the extension. Replaces arche.cliPath, still read when this is empty.
arche.paths.compiler empty archec, the arche-lang compiler's command line (the program, or its cli.js), that Start Live and Explain & Fix run. Empty: the copy bundled with the extension, else archec on the PATH. Replaces arche.archecPath, still read when this is empty.
arche.executablePath empty Deprecated. Use arche.paths.app: the same, by its purpose. Still read when that one is empty. The Arche app binary used by Open in Arche.
arche.cliPath empty Deprecated. Use arche.paths.appCli: the same, by its purpose. Still read when that one is empty. Path to arche-cli (arche-cli.mjs), the Arche command line the extension runs — the Documentation view, among others. Empty: the copy bundled with the extension.
arche.archecPath empty Deprecated. Use arche.paths.compiler: the same, by its purpose. Still read when that one is empty. Path to archec (the compiler's command line, or its cli.js) that Start Live and Explain & Fix run. Empty: the copy bundled with the extension, else archec on the PATH.

Walkthrough#

Get started with arche-lang#

From a requirement to its proof: read it, see its states, run its test, break it and fix it, then generate C. Each step completes by itself when it is done. It is under Help › Welcome › Walkthroughs, and arche-lang: Get Started with arche-lang opens it.

  1. Open or create a project. A project is a folder with a main.arche that starts with project. Make one from a template, or open a folder that has one. New Project… Open Example…
  2. Read the requirement. A requirement says what the system shall do. The line above it says what proves it today. Show the Requirement The syntax on one page: Cheat Sheet.
  3. See its states in the diagram. The component that satisfies it has a state machine. The diagram draws it beside the editor. Show the States
  4. Run its test and watch it turn proven. The test case says what the requirement means. Run it: the line above the requirement turns to ✓ proved. Run Tests
  5. Break it, then fix it with a quick fix. Make a typo, read what the editor says, and let the quick fix (⌘. / Ctrl+.) put it right. Show Where
  6. Generate C. The same model is the code's specification: C99 into generated/, your edits between USER CODE markers kept. Generate C
  7. Optional: a board and its tools (on the desktop). When the model runs on hardware, pick its board, then let the Environment view list the tools it needs and set them up. Add a Board… Set Up the Environment…
  8. Optional: a board and its tools (in a browser). When the model runs on hardware, pick its board: drag it from the diagram's palette, or add it from a list. Add a Board…