Skip to content

rvost/dayz-ce-schema

Repository files navigation

DayZ CE Schema for VS Code

Visual Studio Marketplace Version (including pre-releases) Open VSX Version

DayZ Central Economy mission files modding made easy!

This extension aims to provide accurate validation that not only detects broken XML (the only type of error that online validators can detect), but also checks for DayZ-specific schema compliance and semantic errors such as referencing non-existent files, spelling errors in flag names and other referenced values, and so on. It also provides context sensitive auto-completion to make typing those lengthy classnames faster and less error-prone. As you would expect from a modern editor, the extension provides code actions to automate common tasks and encourage good habits (such as file splitting). And other useful features such as tooltips and the "Open Documentation" command.

Happy editing!

If you found this extension helpful, please consider starring ⭐the repository on Github or rating (or reviewing) it on marketplaces ([1], [2]).

Features

Autocompletion

Autocompletion

Validation

Validation

Code Actions (WIP)

Code Actions

Tooltips on hover (WIP)

Tooltips

Documentation:

Open Documentation

Snippets

The following snippets are currently available:

  • typ - type snippet for types.xml, including all elements except tag;
  • evn - event snippet for events.xml;
  • msg-d - message snippet with a deadline;
  • msg-r - repeating message snippet;
  • msg-c - on connection message snippet;
  • spwn-a - spawnable type with attachment snippet;
  • spwn-c - spawnable type with cargo snippet;
  • spwn-p - spawnable type with preset snippet;
  • ldt-s - loadout slot snippet for spawning gear configuration;
  • ldt-i - loadout item snippet for spawning gear configuration.

Planed features

  • Provide full project validation.
  • Provide quick fixes for common validation errors.
  • More code actions for day-to-day task automation.
  • One-click navigation to symbols (e.g. to the preset referenced in cfgspawnabletypes.xml).
  • Classnames auto-completion in JSON files

Requirements

This extension requires Java (17 or newer), so make sure you have this installed.

It also relies on the XML extension for schema validation, but this can be installed automatically if you don't have it.

Known Issues

  • Only open files can be validated. You won't get any validation errors until you open the file in the editor.

  • Completion and validation for Object Spawner custom lists currently only works for json files in the objectSpawners folder. For example, the objectSpawners/nwaf.json file will have completion and validation according to the Object Spawner rules, but custom/berezino.json or altartrader.json will not. This is due to limitations of the VS Code JSON Schema API and may be resolved in the future.

  • Completion and validation for Spawning Gear Configuration currently only works for json files in the spawnPresets folder or files which name ends with _loadout (e.g. deathmatch_loadout.json).

  • Fragments inserted by code actions may not be formatted correctly. You can easily fix this with auto-formatting (Shift+Alt+F by default).

Related projects

The DayZ CE Schema extension focuses on direct XML (and JSON) file editing. If you prefer a more high-level Excel-like approach, you may be interested in my DayzServerTools or Shawminator's DayZeEditor. Both are standalone Windows applications.

Release Notes

1.0.0

  • Stable release of Language server for DayZ mission XML files.
  • Added support for copying elements from external custom files.
  • Added snippets for types.xml, events.xml, messages.xml, cfgspawnabletypes.xml and spawning gear configuration.
  • Added automatic schema resolution for custom files.
  • Added support for new files when moving and copying elements of custom files.
  • Fixed noisy errors in external files. Disabled mission-scoped validation for files outside the mission folder.

0.9.0

  • Added completion and validation for events.xml.
  • Added completion and validation for cfgeventspawns.xml.
  • Added validation for globals.xml.
  • Added completion and validation for cfgenvironment.xml.
  • Added completion and validation for mapgroupproto.xml.
  • Added completion and validation for mapgrouppos.xml.
  • Added diagnostic for unused custom files (not registered in cfgeconomycore.xml).
  • Added informational diagnostics for files outside the mission folder.
  • Added error diagnostics for the case where the type registered in the cfgeconomycore.xml file doesn't match the contents of the file.
  • Added quick fix for registering unused custom files in cfgeconomycore.xml. External files would be copied to the mission folder.
  • Added quick fix for file type mismatch.
  • Added refactoring action to move and copy elements between registered custom files.

0.7.1

  • Added classnames completion and validation for types, spawnabletypes and cfgrandompresets.xml files.
  • Improved completion and validation. See CHANGELOG for more details.
  • Fixed high CPU usage at idle.
  • Fixed completion for folder names in cfgeconomycore.xml.

0.7.0

0.6.0

  • Stable release for the DayZ 1.23 Update.

0.5.0

  • Updated schemas for DayZ 1.23 Experimental.
  • Added schema for Spawning Gear Configuration.

0.4.0

  • Added Ability for users to add documentation links.
  • Added schema for the Object Spawner custom lists.
  • Updated release workflow. From now on, odd minor version numbers will indicate pre-releases.

0.2.0

  • Added schema associations for modded CE files.
  • Added context aware documentation.

0.1.0

Initial release of the extension.

  • Added schema association on activation for standard CE files.