Skip to the content.

arbor in VS Code

The extension edits .arbor files as text, with the language server’s diagnostics, completion and navigation, and as a diagram. Both views edit the same file: the text stays the source of truth, and the diagram writes its changes into it. Where things sit on the diagram is kept separately, in a <name>.arbor.view.json file next to the model.

The screenshots use examples/tour.arbor, a small model on the software and persistence profiles.

Opening a diagram

Open an .arbor model and run Arbor: Open Diagram, or use the Explorer’s context menu, or Open Diagram to the Side on the text editor’s title bar. From a diagram, Arbor: Open Text (also on its title bar) opens the text beside it.

The text and the diagram of tour.arbor side by side

Edits go both ways:

A file that holds a profile has no diagram of its own: its kinds appear in the palette of every model’s diagram.

Toolbar

At the top right of the canvas:

The layout menu

How elements are drawn

Boxes, property lists and rows

Nodes. An element is drawn as its kind’s visual: shape, colour, label, and SVG, image or emoji.

Properties. The properties written in an element’s text are listed under its name, one name = value line each, like a UML class’s attributes: Customer above shows tableName and description. Profile defaults aren’t listed (they’re in the Properties view), and references are drawn as edges instead. Strings are quoted; long lines are cut with …. The lines are text on their node: click one and you select the node.

A node with properties, or one that holds other elements, is drawn as a box with a header. A kind whose shape isn’t a box (Interface is a circle) shows that shape at the left of the header instead, and so does an SVG or emoji. A node with neither keeps its kind’s shape (Payments above).

Containment. By default an element is joined to what it contains by a composition edge (◆). It is drawn inside its owner instead when the owner’s kind sets container: true (as Package and Component do in the software profile), or when its own kind sets member: true: Field, and so Column, are members, so an Entity’s columns are rows in its box, like a UML class’s attributes:

Edges. References are arrows, labelled with the reference’s name. An edge meets a row at its left or right end, whichever faces the other node. Where several edges would meet one side of a node at the same spot, their ends are spread along it, in the order the edges arrive, so their markers don’t overlap (on a crowded row end, the markers also shrink to fit). Where two edges cross, the more horizontal one hops over the other with a small arc, so a crossing never looks like a junction. Edges leaving a container are drawn over it.

Moving. Dragging a top-level node moves it; dragging a container moves its contents with it. An element inside a container goes back where it was when you let go: its container decides where it goes. (Moving an element to another container, or reordering it, by dragging is planned.)

Properties view

The Properties view (Arbor Properties in the secondary side bar, where Chat sits) shows a form for the element selected in the diagram you last used. Every property of its kind is there, defaults greyed out; a change is written to the text as you type. Show in text jumps to the element.

The Properties view for Customer

Like any view, it can be dragged elsewhere, collapsed or closed. Arbor: Show Properties (also on the diagram’s title bar) brings it back.

Workspace trees

The Arbor activity bar lists the workspace’s profiles and models:

Selecting an item shows it in the text. A model’s inline button opens its diagram, and an element’s (Reveal in Diagram) selects it in the diagram.

The Arbor activity bar

The view file

<name>.arbor.view.json holds, per element ID, the position (and size, if you resized it) of each top-level node, and the bend points of each edge. It is written by the diagram only. With Explorer file nesting on (explorer.fileNesting.enabled), it is shown under its .arbor file. Elements without an entry are placed automatically, and pinned there the first time the diagram is opened. Deleting the file resets the layout.

Element IDs come from @"id" where an element has one, else from its qualified name, so renaming an element without an @"id" loses its place.

Known limitations