Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>ifdef-loader Syntax HighlightingNew to Visual Studio Code? Get it now.
ifdef-loader Syntax Highlighting

ifdef-loader Syntax Highlighting

Reece Como

|
1 install
| (0) | Free
Syntax highlighting for ifdef-loader conditional compilation comments in TypeScript and JavaScript files.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

ifdef-loader Syntax Highlighting

Visual Studio Marketplace License: MIT

Syntax highlighting for ifdef-loader conditional compilation comments.

  • ✅ Supports built-ins: #if, #else, #elif, #endif
  • ✅ Supports #code uncomment prefix blocks (and custom prefixes)
  • 🟡 Not supported: "ifdef-triple-slash": false
Example usage

Recommended: Enable block highlighting

Configure block-level highlights - e.g. using the Highlight extension:

// .vscode/settings.json
{
  "highlight.regexes": {
    "( *\/\/\/ #if.*)((?:.|\n)*?\n)( *\/\/\/ #endif)": {
      "filterFileRegex": ".*\\.(?:jsx?|tsx?)$",
      "regexFlags": "gm",
      "decorations": [
        {},
        {
          "isWholeLine": true,
          "dark":  { "backgroundColor": "#ffa81d28" },
          "light": { "backgroundColor": "#ffa81d10" }
        },
        {}
      ]
    },
    "( *\/\/\/ )(#(?:if|elif|else|endif))": {
      "filterFileRegex": ".*\\.(?:jsx?|tsx?)$",
      "decorations": [
        {
          "isWholeLine": true,
          "dark":  { "backgroundColor": "#ffa81d26" },
          "light": { "backgroundColor": "#ffa81d20" }
        },
        {
          "fontWeight": "600"
        }
      ]
    }
  }
}

Build

npx vsce package

Test

git checkout git@github.com:reececomo/ifdef-loader-syntax-highlighting

cd ifdef-loader-syntax-highlighting

code --install-extension ./ifdef-loader-syntax-highlighting-0.1.0.vsix
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft