A language syntax highlighter and code completion extension for editing Xule with Visual Studio Code.
The settings .zip file below includes a Visual Studio Code .code-workspace and settings files corresponding to the reference implementation code (source folder) included in every Data Quality Committee Rules release (DQC).
The files in the .zip linked below include:
- a DQC.code-workspace file defining folders corresponding to the reference implementation
- settings.json files that define imports and namespaces required by the Xule Editor in each workspace folder, and
- US GAAP and IFRS Taxonomies in .json format called by the settings.json files.
Together, these resources enable highlighting and code completion in the Xule Editor.
Getting Started (Watch video)
- Install the latest Xule Editor.
- Download and extract all folders and files from the dqc-xule-settings.zip archive into the
dqc_us_rulessubdirectory of the release, so that thetaxonomyfolder is at the same level as the existingsourcefolder.
Proceed with caution - the extract process will create or replace existing workspace, settings and taxonomy files in the DQC reference implementationsourcefolder structure. If you are not sure how to proceed safely, consider manually copying from the files in the .zip into the appropriate settings file. XBRL US is not responsible for overwritten settings.
Once the DQC.code-workspace and .json files are extracted, open the DQC.code-workspace file from Visual Studio Code's "Open Workspace..." prompt under the program's File menu. Browse the folders by year (US GAAP above IFRS, separated by a common lib folder), and open a .xule file for one of the DQC Rules. If the Visual Studio Code view includes underlined text in the body of the editor, warnings or errors listed for the file (like the image at left below), try the following steps:
- Check the location of the settings.json file(s) and the contents of the file itself against the corresponding file(s) in the .zip, to be sure the xule.autoImports and xule.namespaces.definitions are correct.
- Check the location of the
taxonomyfolder and its contents, to be sure it matches the contents of the .zip archive. - MacOS users might need to remove the '../../lib/' string from the functions.xule and version.xule entries in the settings.json files.
- Check that the settings.json file is being read properly by the Xule Editor extension - open the settings for the extension, then browse to the corresponding folder(s) using the dropdown, to confirm that the Auto Imports and Namespaces: Definitions are listed (like the image at right below). If not, try uninstalling and reinstalling the Xule Editor extension.
This repository includes a .devcontainer configuration for GitHub Codespaces (or any Dev Containers-compatible editor) that spins up a ready-to-run XULE development environment, without any manual setup:
- Click Code > Codespaces > Create codespace on master (or open the repo in a local Dev Container).
- Wait for
postCreateCommandto finish running.devcontainer/setup.sh, which:- Installs Python and Arelle with the dependencies XULE and the DQC rules require.
- Installs the XULE Arelle plugin (cloned from xbrlus/xule) along with the EDGAR transform and validate plugins.
- Downloads the latest dqc_us_rules release into a
dqc_us_rules/folder at the repo root (resources, source, and taxonomy for the most recent year), reusing this checkout's ownsource/us/<year>/.vscode/settings.jsonfor that folder. - Writes a
.vscode/settings.jsonat the repo root with thexule.autoImportsandxule.namespaces.definitionsneeded by the Xule Editor extension to resolve the downloadeddqc_us_rules/content.
- The Xule Editor (
XBRLUS.xule) and Python (ms-python.python) extensions are installed automatically in the codespace.
Once setup completes, run XULE rules from the terminal with, e.g.:
python -m arelle.CntlrCmdLine --plugins "xule|EDGAR/transform|EDGAR/validate" [other options]



