Skip to content

Commit 837ec04

Browse files
committed
chore: rename prefix to suffix
1 parent 890f8fc commit 837ec04

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class ComponentTagNameProvider : XmlTagNameProvider {
1818
val result = mutableListOf<String>()
1919
FilenameIndex.processAllFileNames(
2020
{
21-
if (it.startsWith("x-") && it.endsWith(TempestFrameworkUtil.TEMPLATE_PREFIX)) {
22-
result.add(it.removeSuffix(TempestFrameworkUtil.TEMPLATE_PREFIX))
21+
if (it.startsWith("x-") && it.endsWith(TempestFrameworkUtil.TEMPLATE_SUFFIX)) {
22+
result.add(it.removeSuffix(TempestFrameworkUtil.TEMPLATE_SUFFIX))
2323
}
2424

2525
true

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ package com.github.tempest.framework
22

33
object TempestFrameworkUtil {
44
const val TEMPLATE_PREFIX = ".view.php"
5+
const val TEMPLATE_SUFFIX = ".view.php"
56
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class ComponentReferenceContributor : PsiReferenceContributor() {
3737
val result = mutableListOf<PsiReference>()
3838

3939
FilenameIndex.processFilesByName(
40-
element.name + TempestFrameworkUtil.TEMPLATE_PREFIX,
40+
element.name + TempestFrameworkUtil.TEMPLATE_SUFFIX,
4141
true,
4242
GlobalSearchScope.projectScope(project),
4343
{

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package com.github.tempest.framework.views.references
33
import com.github.tempest.framework.php.getPhpViewVariables
44
import com.intellij.codeInsight.completion.InsertionContext
55
import com.intellij.codeInsight.completion.XmlAttributeInsertHandler
6-
import com.intellij.psi.PsiElement
76
import com.intellij.psi.PsiPolyVariantReferenceBase
87
import com.intellij.psi.ResolveResult
98
import com.intellij.psi.html.HtmlTag
@@ -12,7 +11,7 @@ import com.jetbrains.php.completion.PhpLookupElement
1211
import com.jetbrains.php.lang.psi.PhpFile
1312

1413
class TempestAttributeReference(element: XmlAttribute, private val htmlTag: HtmlTag) :
15-
PsiPolyVariantReferenceBase<PsiElement>(element, element.nameElement.textRangeInParent, false) {
14+
PsiPolyVariantReferenceBase<XmlAttribute>(element, element.nameElement.textRangeInParent) {
1615
override fun getVariants(): Array<out Any> {
1716
val fileReferences = htmlTag.references.filter { it is Immediate<*> }
1817

@@ -41,4 +40,6 @@ class TempestAttributeReference(element: XmlAttribute, private val htmlTag: Html
4140

4241
return emptyArray()
4342
}
43+
44+
override fun isSoft() = !element.name.startsWith(":")
4445
}

0 commit comments

Comments
 (0)