Mule XML Formatter is a Visual Studio Code extension that formats Mule XML files by delegating formatting to the Red Hat XML extension.
What it does
Registers a mule-xml language in VS Code.
Activates when a Mule XML file is opened.
Temporarily treats the document as standard XML.
Invokes the installed XML document formatter.
Restores the original Mule XML language after formatting finishes.
This keeps formatting behavior simple while reusing the mature XML formatting support provided by redhat.vscode-xml.
Features
Format Mule XML files with the standard Format Document action.
Reuse Red Hat XML formatting rules instead of maintaining a separate formatter.
Minimal extension footprint with a single formatting provider.
Requirements
Visual Studio Code ^1.80.0
Red Hat XML extension: redhat.vscode-xml
The XML extension is declared as an extension dependency, so VS Code will prompt to install it when needed.
How to use
Open a Mule XML file.
Run Format Document.
The extension switches the file to XML, runs the XML formatter, and switches it back.
Extension behavior
Activation event: onLanguage:mule-xml
Contributed language id: mule-xml
Supported file extension: .xml
Development
Install dependencies
yarn install
Build
yarn compile
Watch mode
yarn watch
Package for production
yarn package
Project structure
src/extension.ts - extension activation and formatting provider.
esbuild.js - build configuration.
package.json - extension manifest, scripts, and contribution points.
Known limitations
Formatting quality depends on the Red Hat XML formatter configuration and behavior.
Because the extension contributes the .xml file extension to mule-xml, you may want to refine language detection later if the workspace contains non-Mule XML files.
No custom extension settings are currently contributed.
Release
0.0.1
Initial formatter implementation for Mule XML files.