Syntax Highlighting

The extension provides syntax highlighting for Codepurify template syntax.

Template Delimiters

{| ... |} delimiters are highlighted with distinct colors:

Highlighted Elements

Keywords

  • if, else, each, raw - Control flow keywords
  • true, false - Boolean values

Variables

  • entity.* - Entity properties
  • field.* - Field properties
  • relation.* - Relation properties
  • global.* - Global properties

Comments

Before/After Example

Before Extension

After Extension

  • Delimiters highlighted in blue
  • Variables highlighted in orange
  • Keywords highlighted in purple
  • Comments in gray

Multi-Language Support

TypeScript Templates (.ts.cpt)

Markdown Templates (.md.cpt)

Host Language Preservation

The extension maintains host language highlighting while adding template syntax highlighting:

  • TypeScript syntax highlighting preserved
  • Markdown syntax highlighting preserved
  • Template expressions highlighted separately