X++ ToolsSyntax highlighting and formatting for Dynamics 365 Finance & Operations X++ in Visual Studio Code. Features
|
| Setting | Default | Description |
|---|---|---|
xpp.format.enable |
true |
Enable the X++ formatter |
xpp.format.braceStyle |
allman |
allman or preserve |
xpp.format.normalizeSpacing |
true |
Normalize spacing around operators, commas, parentheses |
xpp.format.maxBlankLines |
2 |
Max consecutive blank lines |
xpp.format.indentCaseLabels |
true |
Indent case labels inside switch |
xpp.xml.formatEmbeddedCode |
true |
Format X++ inside <Source>/<Declaration> CDATA |
xpp.xml.formatStructure |
true |
Re-indent the XML element structure |
xpp.xml.embeddedIndentSize |
4 |
Indent size for embedded X++ |
Installation
Download xpp-language-tools-<version>.vsix from the
latest release, then either run
code --install-extension xpp-language-tools-<version>.vsix or use Extensions → … → Install from VSIX… in VS Code.
Development
No build step: the extension is plain JavaScript.
# run tests (Node, or VS Code's bundled runtime if Node isn't installed)
$env:ELECTRON_RUN_AS_NODE=1; & "$env:LOCALAPPDATA\Programs\Microsoft VS Code\Code.exe" test/run-tests.js --show
# debug: open this folder in VS Code and press F5 ("Run Extension")
# package & install
pwsh ./build-vsix.ps1
code --install-extension .\xpp-language-tools-1.0.0.vsix
Releasing
Bump version in package.json, add a CHANGELOG.md entry, commit, then push a matching tag
(git tag v1.0.1; git push origin v1.0.1). The Release workflow runs the tests, builds the .vsix
with vsce, attaches it to a new GitHub Release and publishes it to:
- VS Code Marketplace if the repository secret
VSCE_PATexists (Azure DevOps personal access token, organization All accessible organizations, scope Marketplace → Manage). - Open VSX if the repository secret
OVSX_PATexists (access token from open-vsx.org).
Secrets are added under Settings → Secrets and variables → Actions. Without them the workflow only
creates the GitHub Release. The CI workflow builds the package with vsce on every push to main.