Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>PieTemplate HighlightNew to Visual Studio Code? Get it now.
PieTemplate Highlight

PieTemplate Highlight

Daevsoft

|
1 install
| (0) | Free
Syntax highlighting support for Pie PHP templates
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

PieTemplate VS Code Extension

PieTemplate is a Visual Studio Code extension that provides syntax highlighting and an improved editing experience for PHP-based template files using custom directives (Blade-like style) with the .pie.php extension.

This extension focuses purely on editor support — it does not render or execute templates.


✨ Features

  • Syntax highlighting for .pie.php files
  • Full HTML support with proper coloring
  • PHP language support inside:
    • <?php ... ?>
    • <?= ... ?>
    • {{ ... }}
  • Highlighting for Pie directives:
    • @if, @elseif, @else, @endif
    • @for, @foreach, @while
    • @endfor, @endforeach, @endwhile
    • @part, @endpart
    • @slot, @use
  • Compatible with Intelephense for PHP IntelliSense
  • Does not interfere with built-in HTML or PHP grammars

📂 File Extension

PieTemplate is automatically enabled for files with the following extension:

.pie.php

🧠 Example

<div class="card">
  @if($user)
    <h3>{{ $user->name }}</h3>
  @else
    <span>Guest</span>
  @endif
</div>

Editor behavior:

  • HTML is highlighted normally
  • Pie directives are colored as keywords
  • {{ ... }} is treated as PHP expression
  • PHP variables and functions are recognized by Intelephense

🎨 Language Mode

This extension registers a custom language in VS Code:

PieTemplate

If it is not selected automatically:

  1. Open a .pie.php file
  2. Click the language selector (bottom-right corner)
  3. Choose PieTemplate

⚠️ Important Notes

Do NOT use files.associations

Avoid adding the following configuration to your settings.json:

"files.associations": {
  "*.pie.php": "php"
}

This will:

  • Disable PieTemplate grammar
  • Remove directive highlighting
  • Prevent PieTemplate language from activating

Let VS Code handle the language automatically.


🧩 Scope & Limitations

This extension does not:

  • Render or compile templates
  • Validate directive pairing (@if / @endif)
  • Replace Blade or other PHP template engines

This extension only enhances editor experience:

  • Readability
  • Syntax structure
  • PHP IntelliSense inside templates

🛠️ Technology

  • TextMate Grammar (.tmLanguage.json)
  • Built-in VS Code HTML grammar
  • Built-in VS Code PHP grammar
  • Intelephense for PHP IntelliSense

🚀 Roadmap

  • Directive snippets
  • Directive autocomplete
  • Basic formatter for PieTemplate
  • Improved nested directive scopes
  • Directive pairing hints

🤝 Contributing

Contributions and ideas are welcome.

This extension is suitable for:

  • Custom PHP frameworks
  • Experimental template engines
  • Learning VS Code extension development

📜 License

MIT License

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft