Skip to main content

Textual editors

This document was generated using AI assistance

Content may include inaccuracies, outdated information, or technical errors. Users are advised to cross-check critical information before implementation.

A model can be edited as text. The editor shows the same model as the diagram and the table, as source in the language of the notation, with highlighting, live checking and completion.

This is not an exported file but the model itself: editing the text edits the model.

Creating a textual representation

Right-click an element in the model explorer and choose New representation. Pick the textual kind in Kind, enter a Name and click Create.

A textual kind exists for notations whose metamodel defines a grammar: which keyword introduces a concept, how an attribute is written, how one element refers to another. Class Model is an example.

Editing the text

The editor parses the text as it is typed. As soon as the text is valid, the model is updated and saved - there is no separate apply step. The model explorer, the properties form, open diagrams and tables and the representations of the other members follow.

Elements keep their identity: renaming in the text renames the same element, with its relationships, its position on the diagrams and its history.

Errors

An error is underlined where it occurred, and hovering explains it: a keyword that does not belong here, a missing part of a construct, a reference to an element that does not exist.

While the text holds an error the model is not changed, so a half-written line never reaches it. Once the text is fixed, the model is updated.

Completion

Press Ctrl+Space and the editor shows what is allowed at the cursor: the keywords and the names of the elements that may be referred to here. Names follow the visibility rules of the notation. A chosen suggestion inserts a real reference, not just a name.

Rewriting the text

An edit in the properties form or on a diagram makes the editor rewrite the text. Formatting comes from the grammar: indentation and the order of elements are the same for everyone editing the model.

Not every textual representation is a language. A representation may hold plain Markdown, which is shown rendered.