Advanced workspace support for S.T.A.L.K.E.R. 2 configuration modding (.cfg).
- Robust Navigation: Instant "Go to Definition" (F12) or
Ctrl+Clickfor:- Prototypes & Structs: Cross-file lookups for base classes and referenced prototypes.
- Resource Files: Direct navigation to files referenced in
{refurl}. - String IDs (SID): Jump to source definitions of unique identifiers.
- Inheritance Visualizer: A dedicated sidebar tree view that shows the complete parent and child hierarchy for any struct.
- Computed View: A resolved view of any object:
- Recursive Resolution: Traces the entire inheritance chain ({refurl}, {refkey}).
- Patch Merging: Correct merges using S.T.A.L.K.E.R. 2 rules ({bpatch},
{bskipref},removenode). - Array Handling: Correctly appends elements via
[*]. - Two-Column Layout: Code on the left, source metadata (file, line, refkey) on the right.
- Smart Validation: Real-time syntax diagnostics for unclosed blocks and duplicate keys.
- Hierarchical Outline: Clean document structure view for easy navigation of massive config files.
- Enum Support: Enhanced features for S.T.A.L.K.E.R. 2 enums:
- Syntax Highlighting: Proper highlighting for
Enum::Memberpairs. - Hover Tooltips: Mouse over any enum to see its numeric value and all other possible members.
- Intellisense: Auto-completion for enum names and members when typing
::.
- Syntax Highlighting: Proper highlighting for
- AST-Powered: High-performance parsing with centralized caching for a smooth experience.
The Inheritance Structure view provides a tree representation of a struct's lineage. The Computed View builds upon this by generating a "final" version of the struct as the game would see it. It features a responsive two-column layout where you can click any source annotation to jump directly to the original file.
The extension provides syntax highlighting for .cfg files, including strings, numbers, keywords, and enums.
Real-time validation helps catch common modding errors like forgetting to close a struct.begin block or using duplicate keys within the same scope.
The Outline view allows for quick navigation through large configuration files by listing all defined structs and their nesting.
- Setup Screen: Upon first installation, the extension will show a setup screen to help you configure your
resourcesPath. You can always re-run this viaStalker 2: Show Setup/Intro Screen. - Resources Path: Set the
stalker2.resourcesPathin settings to your unpacked game data folder (must contain theStalker2subfolder). - Indexing: The extension automatically indexes files on demand to keep memory usage low.
| Setting | Description | Default |
|---|---|---|
stalker2.resourcesPath |
Path to extracted Stalker 2 resources. | "" |
stalker2.search.maxDepth |
Maximum directory depth for symbol scanning. | 12 |
stalker2.search.maxFiles |
Maximum number of files to scan during search. | 50000 |
stalker2.search.timeout |
Timeout (ms) for global search operations. | 15000 |
Stalker 2: Show Setup/Intro Screen: Opens the interactive onboarding screen.Stalker 2: Show Inheritance Structure: Opens the tree view for the struct under the cursor.Stalker 2: Show Computed View: Opens the resolved/merged view for the struct under the cursor.Stalker 2: Clear Symbol Cache: Resets the internal symbol and AST cache.
npm installF5to start debugging.npm run packageto generate a.vsixin./built/.
The extension comes with a pre-built list of S.T.A.L.K.E.R. 2 enums. If you need to update this list from a new version of the game:
- Obtain the
Stalker2_enums.txtfile (usually found in community modding resources or dumped from the game). - Run the transformation script to update the internal TypeScript enum class:
node tools/transform-enums.js path/to/Stalker2_enums.txt src/stalkerEnums.tsThis will parse the C++ enums and update src/stalkerEnums.ts with a minified version used by the extension for hover info and intellisense.
This Visual Studio Code extension is powered exclusively by spite.
Inspired by and code partially stolen from stalker2-cfg-extension by Felicheat.



