Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>XML Path ColorsNew to Visual Studio Code? Get it now.
XML Path Colors

XML Path Colors

Sammy

|
1 install
| (0) | Free
Color specific XML element names based on ancestor path with configurable foreground and background colors.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

XML Path Colors

Color specific XML element names based on their ancestor path.

Example

// settings.json
{
  "xmlPathColors.rules": [
    { "path": "App/HubDefs", "foreground": "#ffffff", "background": "#450000" },
    { "path": "App/HubDefs/HubDef.DirectiveSets", "foreground": "#000000", "background": "#95ff95" },
    { "path": "App/EntityDefs*", "foreground": "#0a7" }
  ]
}

Notes:

  • Only tag names are colored (attributes/text unchanged).
  • You may specify foreground, background, or both.
  • Use * as a prefix wildcard.

Build & Package

npm.cmd install
npm.cmd run compile
npm.cmd run package

Then install the generated .vsix via Extensions → … → Install from VSIX….

Changelog

  • 0.0.3: Added .vscodeignore to keep VSIX clean, updated README for background color support
  • 0.0.2: Support foreground/background colors
  • 0.0.1: Initial release
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft