Tonto
Tools

VS Code Extension

Use the Tonto VS Code extension for editing, validation, snippets, commands, and diagrams.

The extension is published as:

Lenke.tonto

It activates for Tonto workspaces and provides editor support for .tonto and .tontodiagram files.

Tonto VS Code extension

Tonto extension editing a University model

Language support

The extension contributes:

  • tonto language for .tonto files.
  • tontodiagram language for .tontodiagram files.
  • TextMate grammars for syntax highlighting.
  • Language configuration for editor behavior.
  • JSON schema association for tonto.json.

Commands

The extension contributes these command palette entries:

Command titleCommand id
Open Tonto Diagramtonto.diagram.open
New Diagram From Current Modeltonto.diagram.createFile
Transform Tonto -> JSONtonto.generateJSON
Transform JSON -> Tontotonto.generateTonto
Init new Tonto projecttonto.initProject
Validate Modeltonto.validateModel
Transform to GUFOtonto.transformModel
Install Packages (TPM)tonto.tpm.install
Add Guidances to project (Work with LLMs)tonto.addGuidances
Add Tonto Skill to projecttonto.addSkill
Open PlantUML Diagramtonto.diagram.plantuml.open
Open Ontology PlantUML Diagramtonto.diagram.plantuml.openProject
Export PlantUMLtonto.diagram.plantuml.export

Tonto command palette

Command palette integration

Validation

Validation runs as you edit and reports syntax and semantic problems inline. Current validators include:

  • Ultimate sortal specialization.
  • Sortal specializes more than one ultimate sortal.
  • Sortal missing an ultimate sortal specialization.
  • Rigid element specializing anti-rigid element.
  • Compatible and redundant ontological natures.
  • Duplicate names and circular specialization.

Tonto validation

Inline semantic validation

Completion and snippets

The language server provides completions for:

  • Class declarations.
  • Datatypes.
  • Attributes and cardinalities.
  • Relations and relation snippets.
  • Generalization sets.
  • Enum snippets.

Tonto completion

Completion and snippets

Settings

The alpha .tontodiagram editor is disabled by default.

Enable it with:

{
  "tonto.features.tontodiagram.enabled": true
}

When disabled, the classic Tonto diagram and PlantUML workflows remain available.

Keybindings

When the diagram editor is focused:

KeyCommand
Alt+FFit to screen.
Alt+CCenter selection.
Alt+EExport diagram to SVG.
DeleteDelete selected element.