Diagnostics and quick fixes
The problems SCS IntelliSense finds while you type, and how to fix them in one click.
Problems are underlined as you type, before you ever start the game. They're also listed in the Problems panel (Control plus Shift plus MCtrl+Shift+M) for every open file.
Levels
| Level | Meaning |
|---|---|
| Error (red) | The game is expected to fail loading this. |
| Warning (yellow) | Probably a mistake, or against SCS's documentation. The game loads it anyway. |
| Hint (dotted) | Against SCS's documentation, but the game's own files do it too. |
The levels are chosen from the game's own files: if the game ships a file that does something, it's never reported as an error.
To hide a level, open the Settings, search for Diagnostics: Enabled
Severities and uncheck it. For example, uncheck warning and hint to see only
errors.
What is checked
Structure (errors)
- A missing
:,{or}, or a}with nothing to close. - A missing or duplicated
SiiNunit { }in a.siifile, or content after its closing brace. - An
@includethat doesn't start its line: the game ignores an indented one. - A quote that never closes (
name: "Big Engine). The text is underlined to the end of its line, and the rest of the file is still read as written. Text that really spans several lines, as in the game's UI files, is fine.
Names
| Problem | Level |
|---|---|
An invalid class name (ui:: with nothing after it, a name starting with a digit) | Error |
An invalid unit name: a part longer than 12 characters, a character other than letters, digits and _, an empty part (a..b), an unmatched quote | Error |
Two units with the same name in one file, nameless ones (.x) included | Error |
| Uppercase letters in a unit name | Hint |
Attributes
These need the schema database, which knows every class of the game, its attributes and their types:
| Problem | Example | Level |
|---|---|---|
| An attribute the class doesn't have | prcie: 18000 | Warning |
| A value the attribute doesn't accept | part_type: factroy | Warning |
| Something other than a number where a number goes | price: abc, unlock: 1.5 | Warning |
| A negative number where only 0 or more is allowed | unlock: -5 | Warning |
| A vector with the wrong count of numbers | color: (1.0, 0.5) for three | Warning |
| Something other than true or false | use_perlin: yes | Warning |
The attribute lists come from the game itself, so an unknown attribute is almost
always a typo. Numbers are accepted in every form the game's own files use: 1.5,
+6, 2e-6, 25.0f, &3f800000, 0x10DE and nil; a bool can also be 0 or
1.
All of these checks also work inside a
.sui fragment, using the class of
the unit that includes it.
The end of the file (warning)
A file should end with a newline. Almost every file of the game does.
Quick fixes
When a problem has one obvious fix, a light bulb appears next to it. Click it, or put the cursor on the problem and press Control plus .Ctrl+.:
| Problem | Fix |
|---|---|
prcie: 18000 | Change to price |
part_type: factroy | Change to factory |
price: "18000" | Remove the quotes |
truck my.truck { | Add the missing : |
price 18000 or price = 18000 | Change to price: 18000 |
my..truck | Change to my.truck |
"my.truck | Add the missing quote, or remove this one |
name: "Big Engine | Close the quote at the end of the line, or remove it |
An indented @include | Move it to the start of its line |
| No newline at the end | Add it |
Shift plus Alt plus .Shift+Alt+. applies the fix right away when there's only one.
Some problems have no quick fix on purpose, because only you know the right
answer: which of two duplicate units to rename, or where a missing } goes.
Not checked
The extension doesn't read the game's archives, so it can't tell whether a path or a pointer to one of the game's files is right. See Files of the game.