-
Notifications
You must be signed in to change notification settings - Fork 1
Editor Features
A guided tour of what the extension does while you edit. This is not an exhaustive reference (the project is in alpha and behavior is still moving), it is meant to show you what is there and when it helps.
Everything here works across your mod, any read-only parent mods, and the vanilla game files, and it is derived from the game's own data so it tracks your patch.
Completion that knows the grammar and the scope. Key positions offer verbs (engine triggers / effects / scope targets plus your own scripted effects and triggers, filtered by whether you are in a trigger, an effect, or a script-value math block). Value positions offer nouns: has_trait = lists traits, trigger_event = lists events, on_actions = { } lists on_actions, loc-valued keys list your mod's loc keys, and prefixes like scope:, var:, culture:, faith:, title: complete their referents. Items valid in the current scope (character vs title vs province, inferred from the block chain) rank first by real-corpus frequency; other-scope items are annotated but never hidden, so you are never blocked by a wrong guess.
Hover docs, merged. Hover a token to see documentation drawn from your script_docs logs (authoritative, your exact patch) and the bundled wiki lists (so it works before you dump anything), the scopes it supports, the current scope chain at the cursor, and the resolved localization text for a loc key. Hover a .dds path and the texture renders inline (see DDS and Images).
Navigation. Go-to-definition (F12), find-all-references (Shift+F12), fuzzy workspace symbols (Ctrl+T) across your mod, parent mods and vanilla, outline / breadcrumbs, and folding. Safe rename (F2) updates a mod-defined name across both script and localization at once (it only renames names your mod owns, never vanilla).
Signature help for $PARAM$s. When you call a scripted effect or trigger, signature help shows its parameters, and completing the call inserts its parameter block ready to fill (paramless ones offer a yes|no choice).
Inline localization. Loc text shows as inlay hints next to keys, a quick-fix lets you edit a key's text in place (writing BOM-correct yml, and routing vanilla-key overrides to localization/replace/), and you can jump between script and loc in both directions. When editing a translation, a reference-language overlay shows the source text.
descriptor.mod support. The launcher descriptor gets its own highlighting, hover docs and completion for every key, with a ready-to-fill example value (for example supported_version offers your installed game version, and tags = { } offers the launcher's category list). A mod folder missing its descriptor.mod gets an error with a one-click CK3: Create descriptor.mod fix.
CK3's default failure mode is silent: a wrong encoding, a folder typo, or one unbalanced brace makes the game ignore your file with no error at all. The extension's own structural diagnostics (source ck3-script) catch exactly that class, instantly and with certainty:
- unbalanced braces (which make the game ignore the rest of the file),
- missing UTF-8 BOM on a loc file,
- a
l_english:header that does not match the_l_english.ymlfilename, - tabs in loc files,
- folder traps like
common/on_actions(it is singular,on_action) orlocalisation/(it islocalization/), - references to mod-namespace events that do not exist,
- schema-required loc keys that are missing.
.mod descriptors get their own checks (source ck3-descriptor): missing descriptor, missing name / version / supported_version, unknown or duplicate keys, and a path= accidentally shipped inside descriptor.mod. Anything deeper than structure is ck3-tiger's job, by design. Every code is listed in Configuration.
ck3-tiger is the deep validator. The extension auto-downloads it (at your request) and runs it on save (debounced) or manually via CK3 Tiger: Run Validation. Its JSON reports appear as native VS Code Problems, carrying both severity and confidence, with every report location mapped into the editor.
Adopting tiger on an existing mod that already has hundreds of warnings? CK3 Tiger: Create Baseline snapshots today's reports and shows only new ones from then on (toggle the filter anytime). There is also a one-shot --unused run and ck3-tiger.conf generation from your settings.
- CK3: New Content scaffolds events, decisions, interactions and on_action hooks that are correct by construction: right folder, BOM'd loc stubs, namespace declared, and on_action hooks written as appends (never overwriting a vanilla on_action).
- CK3: Launch CK3 (debug mode) starts the game, and CK3: Toggle error.log Watcher streams script errors from the running game into the editor as squiggles as they happen.
- Translation: scaffold a whole language with CK3 Localization: Add Language, then work through it with the coverage-driven CK3 Localization: Translate Missing Keys loop. To translate someone else's mod, CK3 Localization: New Translation Mod (see Multi Mod and Translation).
- CK3: Show Dependencies of Definition at Cursor lists what references a definition and what it references.
- CK3: Open Format Docs (.info) for This File opens Paradox's own folder schema doc for whatever you are editing.
Snippets cover the common blocks, and a deliberately conservative formatter handles indentation only (it will not reflow your script). To silence a specific diagnostic on one line, drop a # ck3m:ignore <code> comment on it (or # ck3m:ignore-next-line <code> above it); a bare # ck3m:ignore silences the whole line. This works for both the extension's structural checks and ck3-tiger's reports. Full details and the code list are in Configuration.
.gui files get completion (properties ranked by real vanilla usage per widget type, using = templates), hover with usage stats, brace diagnostics, and go-to-definition through using splices and base-type chains. Bracketed data-binding expressions ([Character.GetFather...]) complete and chain through return types in both .gui and localization files. See Sidebar Views for the GUI Widget Tree and the layout preview.