Skip to content

Commit 72eab34

Browse files
authored
fix: skip built-in attributes so the IDE can resolve the symbols (#40)
2 parents 8ba4d89 + 30dad79 commit 72eab34

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/main/kotlin/com/github/tempest/framework/TempestFrameworkUtil.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,12 @@ package com.github.tempest.framework
33
object TempestFrameworkUtil {
44
const val TEMPLATE_SUFFIX = ".view.php"
55
const val COMPONENT_NAME_PREFIX = "x-"
6+
7+
val BUILT_IN_DIRECTIVE_ATTRIBUTES = setOf(
8+
":if",
9+
":elseif",
10+
":else",
11+
":foreach",
12+
":forelse",
13+
)
614
}

src/main/kotlin/com/github/tempest/framework/views/references/ComponentReferenceContributor.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ class ComponentReferenceContributor : PsiReferenceContributor() {
7575
val attribute = element as? XmlAttribute ?: return emptyArray()
7676
val htmlTag = attribute.parent as? HtmlTag ?: return emptyArray()
7777

78+
if (attribute.name in TempestFrameworkUtil.BUILT_IN_DIRECTIVE_ATTRIBUTES) {
79+
return emptyArray()
80+
}
81+
7882
return arrayOf(TempestAttributeReference(element, htmlTag))
7983
// .apply { println("found references for ${element} ${this.joinToString { it.toString() }}") }
8084
}

0 commit comments

Comments
 (0)