ZedScriptsThis VS Code extension provides comprehensive support for Project Zomboid's scripts, also known as ZedScripts, including syntax highlighting, auto-formatting, and diagnostics for items, recipes, and other script blocks. This extension is a fork of pz-syntax-extension with an almost complete rewrite and many added features, notably the usage of a common data repository.
Features
Syntax highlight:
Usage
If your file isn't recognized as a Project Zomboid script file, it means it doesn't follow any of the currently documented root files conditions. You can still manually set the language mode to "ZedScripts" which will default the root file type to ROOT-Scripts:
When anywhere in a script file, you press Ctrl + Space to show the auto-completion suggestions which will list all the possible script blocks and parameters within a specific block. 389 You can hover different elements with your mouse to show additional information about them, including a link to the ScriptsDocs page for that element. When an error or warning appears, you can right click on it and select "Quick Fix" to see if a quick fix is available for that specific diagnostic. ConfigurationsLibrariesYou can provide a path to a set of libraries that contain scripts to provide as references for ZedScripts. These libraries will be parsed when launching the extension, and will provide access to blocks that are referenced to. By default, the extension sets the default Project Zomboid install directory on a Windows system as a library, which is DiagnosticsYou can disable a specific diagnostic entirely by adding its ID to the A full list of the available diagnostic types can be found in DiagnosticTypesList AnnotationsThanks to the use of annotations, you can deactivate specific diagnostics for specific blocks and parameters. For blocks, annotations are in the following format:
For parameters, annotations are in the following format:
Data Sources
The extension uses the pz-scripts-data dataset to provide the latest information about Project Zomboid scripts. By default, a bundled version of the data is included with the extension, but you can also activate the automatic fetching of the latest data from the repository via the extension settings. The data is cached for 12 hours, after which it will be fetched again. If the fetch fails, the extension will fall back to the bundled data. This could prove unstable if the dataset format changes. You can fetch the data manually by running the command "ZedScripts: Force fetch Scripts Data" from the Command Palette (Ctrl + Shift + P). This won't directly update the diagnostics (due to a bug to fix, see #2) so you will have to restart VSCode. BuildFirst setup the project by installing the dependencies:
To build the extension, run the following command in the terminal:
Alternatively, a Makefile is provided with a
LicenseThis project is licensed under the MIT License. See the LICENSE file for details. ChangelogYou can find a full list of changes in CHANGELOG. |
Diagnostics:
Parameter hovering:
