Problems, hints and quick fixes
The Problems panel runs along the bottom of the workspace. It lists what is wrong, or could be better, in every file of the project, not only the open one.
Reading the panel
The header sums up the project: ❌ 3 errors, ⚠ 2 warnings, or ✓ No problems. Click the header to fold or unfold the panel; drag its top edge to resize it.
Below, problems are grouped by file. Click a file name to fold its group. Each row shows:
❌ 14:12 unknown property `titel` in fact `hobbit` [Replace with `title`]
did you mean `title`?
| Part | Meaning |
|---|---|
| Icon | The severity, see below. |
line:col | Where the problem is. Click the row to open the file at that spot. |
| Message | What is wrong. |
| Button | A quick fix, when there is one. |
| Second line | A hint on how to fix it, when the checker has one. |
While your latest edit is being checked, the list is dimmed with ⟳ updating… and cannot be clicked, so you never apply a fix to a problem that is already gone.
Severities and filters
| Icon | Severity | Meaning | Filter |
|---|---|---|---|
| ❌ | Error | The project does not compile, or compiles to something wrong. | Errors |
| ⚠️ | Warning | Compiles, but is probably a mistake or breaks a convention. | Warnings |
| 💡 / ℹ️ | Hint / Info | Style suggestions. They are listed here but not underlined in the editor. | Hints |
Untick a filter to hide that severity. The counts in the header always include everything.
The file tree also shows error and warning counts next to each file.
Quick fixes
A problem with a mechanical fix has a button on its row, labelled with what it will do. Click it to apply the edit. The same fix is offered in the editor, as a 💡 … — click to insert line above the block and in the tooltip of the underlined text (see The Dolfin editor).
A fix can change another file than the one with the problem. It is saved like any edit, and the problem disappears once the project is checked again.
| Fix | Offered for |
|---|---|
Declare concept X | A reference to a concept that does not exist. Adds concept X to the current file. |
Declare concept X in file | The same, when the name points to another file of the project (for example animals.Dog). Adds the declaration at the end of that file. |
Create file and declare concept X | The same, when that file does not exist yet. |
| Replace with ‘…’ / Replace with qualified name ‘…’ | A misspelled type or property that is close to an existing one. |
| Rename to ‘…’ | A concept not in PascalCase or a property not in camelCase. Renames the declaration and its uses. |
Wrap word in backticks to use it as a name | A keyword used where a name is expected, for example has date: date. Turns it into `date`. Not offered when no name could go there (e.g. concept Foo is). |
| Remove trailing whitespace | Spaces at the end of a line. |
| Remove extra blank lines | More than two blank lines in a row. |
What is checked
Besides syntax errors, which come with a hint when the parser can guess what you meant, the checker reports the following. For what the language allows, see the Dolfin language documentation.
Errors
| Message | Why |
|---|---|
| Unresolved type ‘X’ in … of ‘Y’ | A field, sub or range names a type that is not declared. When a close name exists, the message ends with Did you mean …? and a fix is offered. |
| Circular inheritance detected for concept ‘X’ | X is, through sub, its own ancestor. |
| Duplicate property ‘p’ in concept ‘X’ | The concept declares has p twice. |
unknown property p in … | A query, rule or fact uses a property that does not exist. When a close name exists, the hint line says did you mean …? and a fix is offered. |
| Silent variable ‘?_x’ cannot appear in the return block of query ‘q’ | ?_ variables mean “value not needed”; they cannot be returned. |
| Query ‘q’ composes undefined query ‘r’ | A query builds on a query that does not exist. |
| Query ‘q’ has a circular composition dependency | Queries that compose each other in a loop. |
Warnings
| Message | Why |
|---|---|
| Concept ‘x’ should be PascalCase | Naming convention. Fix: Rename to ‘X’. |
| Property ‘X’ should be camelCase | Naming convention. Fix: Rename to ‘x’. |
| Enum variant ‘x’ should be UPPER_CASE or PascalCase | Naming convention for the values of a one of: block: RED or Red, not red. No automatic fix, pick one style yourself. |
| Prefix ‘p’ is declared but never used | Leftover prefix line. |
| Variable ‘?x’ in rule ‘r’ appears only once | The variable neither joins two match lines nor reaches then. Usually a typo. If it is on purpose, name it ?_x. |
| Variable ‘?x’ in query ‘q’ appears only once | Usually a typo. If it is on purpose, name it ?_x. |
`=` / `!=` on a quantity is unreliable after unit normalisation | Two equal quantities in different units may not compare equal. Use >, <, >= or <=. |
Hints
| Message | Why |
|---|---|
| Trailing whitespace on line N | Fix: Remove trailing whitespace. |
| Too many consecutive blank lines | Fix: Remove extra blank lines. |
| Declarations should come after all prefix declarations | Put prefix lines at the top of the file. |
When the project does not compile
The outputs keep the last version that compiled, dimmed, with a note such as Showing the last valid graph; the current source doesn’t parse yet. See Problems below. The Turtle download is disabled until the errors are fixed. See Compiled output.