# JQHTML Component Highlighting in RSpade VS Code Extension
## Version 0.1.39 - Added JQHTML Component Support
The RSpade VS Code Extension now includes syntax highlighting for JQHTML components in Blade PHP files.
## What Gets Highlighted
### 1. Uppercase Component Tags
Any tag starting with an uppercase letter is treated as a JQHTML component and highlighted distinctively:
```blade
{{-- These get highlighted as JQHTML components --}}
Content here
{{-- Regular HTML tags remain standard --}}
```
### 2. JQHTML Slots
Slot tags for components with multiple content areas:
```blade
{{-- Slot tags are highlighted specially --}}
Name | Email | Status
<%= row.name %> | <%= row.email %>
No data found
```
### 3. Blade Directives for JQHTML
The `@jqhtml` directive and `Jqhtml::component()` calls:
```blade
{{-- Blade directive --}}
@jqhtml('User_Card', ['name' => 'John'])
{{-- PHP helper --}}
{!! Jqhtml::component('User_Card', ['name' => 'John']) !!}
```
## Color Scheme
The extension uses the TextMate scope `entity.name.class.component.jqhtml` which provides:
| Theme | Typical Component Color |
|-------|-------------------------|
| Dark+ (VS Code default) | Cyan (#4EC9B0) |
| Light+ (VS Code default) | Teal (#267F99) |
| Monokai | Green (#A6E22E) |
| Dracula | Cyan (#8BE9FD) |
| Solarized Dark | Cyan (#2AA198) |
| Nord | Teal (#88C0D0) |
## How It Works
The extension injects TextMate grammar rules into PHP and Blade files to:
1. **Identify Component Tags**: Patterns match tags starting with uppercase letters
2. **Highlight Component Names**: Apply distinctive coloring to component names
3. **Preserve Blade Syntax**: Handle Blade expressions within component attributes
4. **Support Slots**: Recognize and highlight `` syntax
## Supported Patterns
### Basic Components
```blade
```
### Components with Content
```blade
Dashboard
Content here
```
### Components with Blade Expressions
```blade
```
### Components with Conditional Attributes
```blade
```
### Nested Components
```blade
@foreach($users as $user)
@endforeach
```
## Installation
The JQHTML highlighting is included in RSpade VS Code Extension version 0.1.39 and above.
To install or update:
```bash
# From the extension directory
./build.sh
# Then in VS Code
# Press Ctrl+Shift+X → ... → Install from VSIX
# Select: rspade-framework.vsix
```
## Technical Details
### Grammar File Location
`/app/RSpade/resource/vscode_extension/syntaxes/blade-jqhtml.tmLanguage.json`
### Injection Points
The grammar is injected into:
- `text.html.php.blade` - Laravel Blade files
- `text.html.php` - Standard PHP files with HTML
### Pattern Matching
- Component opening tags: `(<)([A-Z][\\w_]*)(?=\\s|>)`
- Component closing tags: `()([A-Z][\\w_]*)(>)`
- Slot tags: `()` and `( )`
## Troubleshooting
If highlighting doesn't appear:
1. Ensure you have version 0.1.39+ of the RSpade extension
2. Reload VS Code window (Ctrl+R / Cmd+R)
3. Check that file is recognized as PHP/Blade
4. Verify your color theme supports the scope
## Future Enhancements
Potential improvements for future versions:
- IntelliSense for component names
- Auto-completion for component attributes
- Go-to-definition for component classes
- Hover documentation for components
- Component validation and error checking