Migrate jqhtml slot syntax from <#name> to <Slot:name>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-11-24 03:43:45 +00:00
parent 22df126977
commit 881425bed6
35 changed files with 124 additions and 122 deletions

View File

@@ -71,11 +71,11 @@ class JqhtmlDefinitionProvider {
}
// IMPORTANT: Check for slot syntax BEFORE extracting word
// This prevents slot names from being treated as component names
// Check if we're in a slot tag by looking for <# or </# before cursor
// Check if we're in a slot tag by looking for <Slot: or </Slot: before cursor
const beforeCursor = line.substring(0, position.character);
if (beforeCursor.match(/<\/?#\s*[A-Z][A-Za-z0-9_]*$/)) {
if (beforeCursor.match(/<\/?Slot:\s*[A-Z][A-Za-z0-9_]*$/)) {
// We're in a slot tag - extract the full slot name from the line
const slotNameMatch = line.match(/<\/?#\s*([A-Z][A-Za-z0-9_]*)/);
const slotNameMatch = line.match(/<\/?Slot:\s*([A-Z][A-Za-z0-9_]*)/);
if (slotNameMatch) {
const slotName = slotNameMatch[1];
console.log(`JQHTML: Detected slot tag syntax for slot: ${slotName}`);
@@ -492,7 +492,7 @@ class JqhtmlDefinitionProvider {
return undefined;
}
/**
* Handle goto definition for slot tags (<#SlotName>)
* Handle goto definition for slot tags (<Slot:SlotName>)
*
* IMPLEMENTATION SCOPE (Narrow, for now):
* - Handles direct extends="ComponentName" on <Define:> tags