Hearts of Modding

An experimental work-in-progress high-performance Visual Studio Code extension for Hearts of Iron IV (HOI4) modding, powered by a dedicated Language Server Protocol (LSP) server written in Rust.
Inspired by CWTools and VModer. Written with performance in mind.
🚀 Features
✍️ Smarter editing
Auto-complete triggers, modifiers, countries, ideas, traits, abilities.
Hover over anything to see what it does: hover a trigger to read its documentation, an idea to see its modifiers, a state ID to see its name, a localization to preview it.
Click to jump to definitions: F12 on any event, idea, character, or focus takes you straight to where its defined.
🔎 Catch mistakes early
Errors for typos, missing brackets, unknown entities, invalid values.
Warns for too high leader skill levels, building levels exceeding their max, or non-existant victory points in a province.
Checks your localization for missing and duplicate keys, unclosed color codes, and invalid scopes/commands.
Validates definition.csv and adjacencies.csv: checks province IDs, terrain names, flags unknown provinces.
Hover over map files to see province terrain, type, and coastal status.
🎨 Better visuals
Vibrant syntax highlighting with custom light/dark VSCode themes: color-coded triggers, effects, modifiers, scope references, and localization strings.
In-editor color previews: localization color codes render as their actual colors right in the editor.
✨ Get started
Install the extension from the VSCode Marketplace or the Open VSX Registry.
Open your mod folder in VSCode.
(Recommended) Set hoi4.gamePath in your settings to your HOI4 installation for vanilla file references.
Happy modding.
🧑🧒 For submods
The extension automatically discovers installed mods and loads them to provide accurate completions and validation in submods as well.
⚙️ Might wanna tweak these
| Setting |
What it does |
hoi4.gamePath |
Path to your local HOI4 install. Enables vanilla + submod data support. |
hoi4.styling.enabled |
✨ Styling suggestions ✨ (tabs vs spaces, trailing whitespace, etc). On by default. |
hoi4.validator.workspaceScan.enabled |
Scan all mod files for errors on startup. Off by default, slow for huge mods. |
hoi4.showMemoryUsage.enabled |
Shows the HoM LSP RAM usage in the status bar. |
⌨️ Commands
Type "Hearts of Modding" in the command palette (Ctrl+Shift+P) to see all commands:
Toggle LSP: Start/stop the language server.
Set Game Path: Point to your HOI4 installation.
Toggle Workspace Scan: Scan all the files for issues.
Toggle Theme: Switch between the extension themes.
☝️ Requirements
A HOI4 install is optional but strongly recommended for the complete experience.
Made with ❤️ by a Hearts of Minecraft mod developer.
| |