Implement JQHTML function cache ID system and fix bundle compilation Implement underscore prefix for system tables Fix JS syntax linter to support decorators and grant exception to Task system SPA: Update planning docs and wishlists with remaining features SPA: Document Navigation API abandonment and future enhancements Implement SPA browser integration with History API (Phase 1) Convert contacts view page to SPA action Convert clients pages to SPA actions and document conversion procedure SPA: Merge GET parameters and update documentation Implement SPA route URL generation in JavaScript and PHP Implement SPA bootstrap controller architecture Add SPA routing manual page (rsx:man spa) Add SPA routing documentation to CLAUDE.md Phase 4 Complete: Client-side SPA routing implementation Update get_routes() consumers for unified route structure Complete SPA Phase 3: PHP-side route type detection and is_spa flag Restore unified routes structure and Manifest_Query class Refactor route indexing and add SPA infrastructure Phase 3 Complete: SPA route registration in manifest Implement SPA Phase 2: Extract router code and test decorators Rename Jqhtml_Component to Component and complete SPA foundation setup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
5.5 KiB
Executable File
JQHTML VS Code Extension
Syntax highlighting and language support for JQHTML template files.
Features
Syntax Highlighting
Full syntax highlighting for all JQHTML constructs:
- Component Definitions:
<Define:ComponentName> - Template Expressions:
<%= expression %> - Control Flow:
<% if (condition) { %> ... <% } %> - Slots:
<#slotname>with let:prop support - Data Bindings:
:property="value" - Event Handlers:
@click="handler" - Special Attributes:
$id="name",$property="value" - Components:
<MyComponent /> - Comments:
<%-- comment --%>
Language Configuration
- Auto-closing pairs: Automatically close tags, brackets, and quotes
- Bracket matching: Highlight matching brackets and tags
- Code folding: Fold component definitions
- Smart indentation: Handles control flow
- Comment toggling: Use standard VS Code shortcuts to toggle comments
Code Snippets
Quick snippets for common patterns:
| Prefix | Description |
|---|---|
define |
Component definition |
definecomp |
Component with structure |
if |
If statement |
ifelse |
If-else |
for |
For loop |
exp |
Expression <%= %> |
$id |
Scoped ID attribute |
:prop |
Property binding |
@event |
Event handler |
slot |
Named slot |
slotprop |
Slot with props |
comment |
Comment block |
Installation
From Marketplace (when published)
- Open VS Code
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "JQHTML"
- Click Install
From Source (Development)
- Clone the JQHTML repository
- Navigate to
packages/vscode-extension - Run
npm install - Run
npm run compile - Copy the folder to VS Code extensions directory:
- Windows:
%USERPROFILE%\.vscode\extensions - macOS/Linux:
~/.vscode/extensions
- Windows:
- Restart VS Code
Using .vsix Package
- Package the extension:
vsce package - In VS Code: Extensions → ... → Install from VSIX
- Select the generated .vsix file
Usage
The extension automatically activates for .jqhtml files. Features include:
Syntax Highlighting
All JQHTML syntax is highlighted with semantic colors:
<Define:UserCard>
<div class="user-card" $id="card">
<h2><%= this.data.name %></h2>
<% if (this.data.isAdmin) { %>
<span class="admin">Admin</span>
<% } %>
<button @click="handleClick">Click Me</button>
<% for (const skill of this.data.skills) { %>
<div class="skill"><%= skill %></div>
<% } %>
</div>
</Define:UserCard>
IntelliSense
Basic HTML tag and attribute completion is provided through VS Code's built-in HTML support.
Code Folding
Component definitions can be folded at the <Define:> level:
▼ <Define:MyComponent>
...
</Define:MyComponent>
Formatting Support
The extension respects VS Code's formatting settings.
Configuration
The extension sets these defaults for JQHTML files:
{
"[jqhtml]": {
"editor.wordWrap": "on",
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": true
}
}
}
You can override these in your VS Code settings.
Theme Support
The extension uses standard TextMate scopes and works with all VS Code themes. For best results, use a theme with good HTML/JavaScript support.
Scope Reference
entity.name.class.component.jqhtml- Component namesentity.name.tag.slot.jqhtml- Slot names (header, row, footer, etc.)keyword.control.slot.jqhtml- Slot prefix#symbolkeyword.control.flow.jqhtml- Control flow keywords (if, for, etc.)punctuation.definition.attribute.special.jqhtml-$prefixpunctuation.definition.attribute.binding.jqhtml-:prefixpunctuation.definition.attribute.event.jqhtml-@prefix
Known Issues
Bracket Matching Errors with Split Control Flow
When using control flow split across multiple <% %> blocks, VS Code may show bracket matching errors:
<% if (condition) { %>
<div>Content</div>
<% } else if (otherCondition) { %> ⚠️ VS Code shows bracket error here
<div>Other content</div>
<% } %>
Why this happens: VS Code's bracket matcher can't track bracket state across separate template blocks. It sees a closing } without a matching opening { in the same block.
Solution: The extension automatically disables bracket colorization for .jqhtml files:
{
"[jqhtml]": {
"editor.bracketPairColorization.enabled": false,
"editor.guides.bracketPairs": false
}
}
These visual errors don't affect functionality.
Other Known Issues
- Complex nested template expressions may not highlight perfectly
- Some edge cases in mixed HTML/JavaScript contexts
Contributing
Contributions are welcome! The extension source is in the JQHTML repository under packages/vscode-extension.
Development
- Clone the repository
- Open in VS Code
- Run
npm install - Press F5 to launch a new VS Code window with the extension
- Open a
.jqhtmlfile to test
Testing
Create test files in test-files/ to verify syntax highlighting:
# Run automated tests
npm test
# Manual testing
# 1. Launch extension (F5)
# 2. Open test files
# 3. Verify highlighting
License
MIT License - See LICENSE file in the JQHTML repository
Changelog
2.0.0
- Initial release
- Full JQHTML v2 syntax support
- Brace-style control flow
- Slot syntax with let:prop
- Data binding and event handlers
- Component highlighting
- Code snippets