The Dolfin editor
.dlf files open in the Dolfin editor. It checks your source as you type, completes names, explains symbols and fixes common mistakes for you.
As you type
| Feature | Behaviour |
|---|---|
| Highlighting | Keywords, names, literals and comments are coloured. Names are coloured by what they are (concept, property…), not only by syntax. |
| Diagnostics | Errors and warnings are underlined, with a marker in the gutter. Hover the underline to read the message. Hints (for example trailing spaces) are not underlined: they are listed in the Problems panel only. |
| Completion | Keywords, and the concepts and properties of the whole project. After a prefix over an import, such as hr:, only the names that import defines. When a keyword such as date is typed where a name belongs, the escaped form `date` is offered too. |
| Hover | Hover a name to see its declaration and its description. When descriptions exist in several languages (#en>, #fr>…), the one shown follows your order in Settings → Languages. Hovering a prefix shows the IRI it expands to. Hovering an imported name shows its label, its IRI and imported from <IRI>@<version>. |
| Indentation | Two spaces. Tab indents the selection, Shift+Tab un-indents it. |
| Comment continuation | Enter on a comment line (# ), a language-tagged comment (#en> ) or an annotation line (#@ ) starts the next line with the same prefix. Backspace right after a bare prefix removes the whole prefix. |
| Reference count | A faint line such as 3 references sits above each concept, property, rule and query declaration. It counts uses across the whole project, not the declaration itself, so 0 references flags an unused name. Click it to list the uses and jump to one. It refreshes each time the file is re-checked, and is shown in read-only files too. Once the declaration is on screen, a count from the project’s saved files is added: 12 instances for a concept (inferred and subclass ones included), the rows a rule’s match: block finds, the rows a query returns, or 5 uses for a property (the triples that use it), each shown as 1000+ past 1000. It updates after each save, and is left out when the count cannot be computed. |
| Folding | Click the arrows in the gutter to fold a declaration, a run of annotations or a group of language-tagged comments. |
Quick fixes
When a problem has a mechanical fix, the editor offers it in two places:
- A line reading 💡 fix — click to insert above the affected block. Click it to apply the fix.
- The tooltip of the underlined text, which lists the same fix as a button.
The fix is also a button on the problem’s row in the Problems panel. A fix may edit another file, or create one: Declare concept Person in people.dlf adds the declaration to people.dlf.
Right-click menu
Right-click in the editor. What the menu shows depends on where you click.
| Item | Shown when | Action |
|---|---|---|
| ✂ Cut / ⧉ Copy | Text is selected. | Clipboard. |
| # Copy name | On a name. | Copies the name as written, for example people.Person. |
| ▢ Select word | On a name. | Selects it. |
| ▢ Select block | Inside a declaration. | Selects the whole declaration (a concept, property, fact…). |
| 🕸 Reveal in graph | On a name. | Switches the output panel to Graph, centres the node and highlights it. |
| 🐢 Reveal in turtle export | On a name, in an ordinary project. | Switches to the Turtle tab and highlights the Turtle generated for that declaration. See Reveal. |
| 🐢 Reveal in turtle source | On a name, in a project imported from Turtle. | Opens the original .ttl at the matching statement. See Reveal. |
| ⇄ Open in mapping editor | Inside a mapping block, for people who may edit the project. | Opens that block in the mapping form. |
| ⎘ Paste | Always. | Pastes the clipboard. Your browser may ask for permission first. |
| ⌖ Go to definition | On a name. | Jumps to its declaration, opening the other file if needed. Same as F12. |
| ℹ Peek info | On a name. | Shows the hover information in a popup where you clicked. Escape closes it. |
| 🔗 Find all references | On a name. | Lists every place the name is used, declaration included. Click one to go there. |
| ✎ Rename symbol | On a name. | Asks for a new name and renames the declaration and every use, in every file. |
The Go to definition, Peek info, Find all references and Rename symbol items appear once the language service has started, a second or two after the page loads.
The Turtle editor has a shorter menu.
To edit a mapping block in a form instead, right-click inside it and choose ⇄ Open in mapping editor, or right-click the file in the file tree and pick the mapping: see The mapping form. Its Edit as text button brings you back here, at the block.
Keyboard
The usual editing keys work: undo and redo, search and replace, bracket matching. See Keyboard shortcuts for the full list.
On a phone or tablet
While you type in a Dolfin file on a touch screen, a row of keys sits on top of the on-screen keyboard: { } : -> ; " Tab Esc Undo Redo. Swipe the row sideways if it does not fit.
- Tab indents, or accepts the open suggestion (on a desktop keyboard Tab only indents).
- Esc only closes the suggestion list; your cursor and selection stay put.
- Undo and Redo follow the shared undo when you edit a file together, so they never undo someone else’s edits. They do nothing when you can only view the file.
- A key acts when you lift your finger, so scrolling the row never types.
The row does not appear in Markdown or Turtle files, in history diffs or source views, or with a mouse.
Editing together
When someone else has the same file open, you see their cursor and selection in their colour, labelled with their name, and their edits appear as they type. Undo only undoes your own edits. See Collaboration.
Who can edit
On a project shared with you as Viewer, the editor is read-only: you can select, copy, hover, search, reveal and go to definition, but Cut, Paste, Rename symbol and quick fixes are not offered. The same goes for an Editor whose plan does not include editing shared projects. See Collaboration.
On a phone or tablet (touch screen, up to 1024 px wide), a file opens read-only, so scrolling does not bring up the keyboard; tap Edit in the bar above the code to start editing. Without edit rights there is no Edit button.