SCS IntelliSense
VS Code language support for SCS Software modding files (Euro Truck Simulator 2 / American Truck Simulator).
Unofficial community project. SCS IntelliSense is not affiliated with or endorsed by SCS Software. Euro Truck Simulator 2, American Truck Simulator and SCS Software are trademarks of their respective owners.
📖 Documentation: how to use every feature, with screenshots.
Features
On from the start:
- 🎨 Semantic highlighting for
.sii and .sui files: class names (and namespaces such as ui::), unit names, attribute keys, values, comments and @include. Materials (.mat), text .tobj, .soundref and .bank.guids files get the same colors.
- 🔍 Diagnostics while you edit: structural errors (missing
:, { or }), invalid class and unit names, duplicate unit names in a file, misplaced @include, a missing final newline, attribute keys the class doesn't have (a typo like prcie, with a quick fix to price) enum values it doesn't list (part_type: factroy → factory), values of the wrong type (price: abc, a float3 with two numbers, use_perlin: yes), and pointers to a nameless unit (.wheel_3) that isn't in the file or its @includes, all checked against the schema database. Checked against 73,224 .sii/.sui files of ATS 1.61 (the base game and 56 DLCs) with no false errors.
- 🔧 Quick fixes for the problems with one obvious fix: click the light bulb (or press
Ctrl+.) to add a missing : or final newline, fix a..b in a unit name, close an unmatched quote, move an @include to the start of its line, correct a misspelled attribute key or enum value, or remove the quotes around a number (price: "18000").
- 📎
@include paths: type @include " to pick a .sui file or folder, relative to the current file, or from the mod root when the path starts with /.
- 💡 Completion for
class_name, attribute keys, enum values (part_type: → factory, aftermarket...), units for pointers (from the same file, then the rest of your mod), and your mod's files for attributes that take a file (model: "/vehicle/..." lists only .pmd files and folders), the events of your sound banks after bank#, from the community schema database. Mods split in base/ and dlc_*/ folders are understood.
- 🖱️ Hover with descriptions of classes and attributes.
- 🧭 Outline, breadcrumbs and Go to Symbol for units, attributes and includes.
- 🧩
.sui fragments (bare attributes pasted into a unit by @include) get completion, hover and the same checks as the unit that includes them, found across your mod's folder.
- 🔗 Go to Definition, Find References and Rename (F2) for unit names, across every file of your mod's folder: Ctrl+click a pointer to jump to its unit, Shift+F12 lists who points to it, and F2 renames it everywhere. Ctrl+click a path (
model: "/vehicle/...", @include "...") to open that file of your mod, and Shift+F12 on it to see every file using it, .mat and .tobj included. The rename only sees text files: if your map uses the unit, rename it in the map editor too.
- 📦 Paths follow your files: rename or move a file or folder in VS Code's Explorer, and every
@include and file path pointing to it (model: "/vehicle/truck/cabin.pmd") is updated right away, like imports in TypeScript, .mat and text .tobj textures and .soundref sound banks included. The changed lines get a mark in the gutter until you save, so you can review them. .mat files are saved right away, and so is everything when a move changes more than 6 other files, with the tabs it opened closed (settings under File Moves). (VS Code asks once before applying an extension's changes to a move; tick "Do not ask me again" to skip it from then on.)
- 📁 File icons for SCS file types (
.sii, .sui, .pmd, .pmg, .pmc, .pma, .tobj, .mat, .soundref, .bank).
Experimental (off by default while it is tested on more mods, see below):
- ✨ Formatter: Format Document, Format Selection, plus commands to check or format every file in the workspace.
Diagnostic levels
- Error: the game is expected to fail loading this.
- Warning: a recommendation from the SCS documentation.
- Hint: contradicts the documentation, but the game's own files do it (for example uppercase letters in unit names).
Choose which levels are shown with scs-intellisense.diagnostics.enabledSeverities.
The formatter is off while it's being validated. To turn it on:
- Open the Settings with
Ctrl+,.
- Search for
@ext:DuHNunes.scs-intellisense to see only this extension's settings.
- Check Formatter: Enabled. It takes effect right away.
Or add it to your settings.json:
"scs-intellisense.formatter.enabled": true
Completion and hover read the community schema database, which lists every class of the game (1,327 in ATS 1.61) with the game's own attribute names and types. Most classes have no descriptions yet; for those, hover shows the type only. Attributes the game no longer uses (legacy) aren't suggested.
The formatter changes only spacing, indentation, brace placement and blank lines. Values and comments are never rewritten, and a file with structural errors is left untouched. Format a file with Shift+Alt+F, or only the units you selected with Ctrl+K Ctrl+F (Format Selection; a cursor inside a unit formats that unit).
Format On Save (scs-intellisense.formatter.formatOnSave, on by default): formats .sii/.sui files when you save them. Nothing else to set up: you don't need editor.formatOnSave or editor.defaultFormatter. Only works while the formatter is enabled, and Ctrl+Z undoes it.
Brace Style (scs-intellisense.formatter.braceStyle): 1tbs (default, { on the header line) or allman ({ on its own line).
Indent Units (scs-intellisense.formatter.indentUnits, on by default): indents the units inside SiiNunit { }. Uncheck to keep them at column 0.
Indentation (tab or spaces, and how many) follows your VS Code settings, so formatting matches what the editor does when you press Enter: editor.tabSize, editor.insertSpaces, and editor.detectIndentation (on by default, it picks up tabs from the game's own files). To set it only for SCS files:
"[sii]": { "editor.insertSpaces": false },
"[sui]": { "editor.insertSpaces": false }
Commands
Open the Command Palette (Ctrl+Shift+P) and type SCS IntelliSense:
- Show Output / Clear Output: the extension's log. By default it shows information, warnings and errors; to see more detail when something goes wrong, pick Debug in the Output panel's log level filter (or run Developer: Set Log Level).
- Copy Bug Report Info: copies your extension and VS Code versions, your SCS IntelliSense settings and the recent log, ready to paste into an issue or forum post.
- Report Issue on GitHub: opens a form with a title and a description already holding the same information; Preview on GitHub opens the new issue in your browser, filled in (needs a GitHub account).
- Refresh Schema Database: download the latest schema now instead of waiting for the automatic update.
- Check Formatting of All Files (formatter enabled): lists every
.sii/.sui in the workspace that would change, without changing anything. The result goes to the Output.
- Format All Files (formatter enabled): formats every
.sii/.sui in the workspace after asking for confirmation. Files that aren't open are changed directly on disk and can't be undone with Ctrl+Z, so use version control (git) or a backup. Never run it on the game's extracted files you want to keep as reference.
Settings
| Setting |
Default |
|
scs-intellisense.semanticHighlighting |
true |
Semantic highlighting |
scs-intellisense.diagnostics.enabledSeverities |
all four |
Which diagnostic levels are shown |
scs-intellisense.schema.fetchTimeoutMs |
8000 |
How long completion/hover wait for the schema |
scs-intellisense.completion.enabled |
true |
Completion |
scs-intellisense.hover.enabled |
true |
Hover |
scs-intellisense.formatter.enabled |
false |
Experimental formatter |
scs-intellisense.formatter.formatOnSave |
true |
Format .sii/.sui on save (while the formatter is enabled) |
scs-intellisense.formatter.braceStyle |
1tbs |
1tbs or allman |
scs-intellisense.formatter.indentUnits |
true |
Indent units inside SiiNunit { } |
scs-intellisense.fileMoves.autoSave |
true |
Save the files a move updated and close the tabs it opened |
scs-intellisense.fileMoves.alwaysSave |
[".mat"] |
File types saved after every move |
scs-intellisense.fileMoves.saveAbove |
6 |
Above this many files of other types, they're saved too (0: always) |
scs-intellisense.fileMoves.notify |
true |
Notify when files are saved (always logged) |
Every setting applies right away, with no window reload.
More info
See the documentation for how to use every feature, the repository for the source code and to report issues, and the forum topic to report without a GitHub account.
Licensed under the MIT License.
| |