From ab4fa36dd69f27c120d2d4c514e41430275ccfdf Mon Sep 17 00:00:00 2001 From: Daniel Espendiller Date: Sun, 25 Feb 2024 11:39:14 +0100 Subject: [PATCH] support vue.js compoenents in any components key --- .../idea/vuejs/index/ComponentUsageIndex.java | 38 +++++++++++++++++-- .../index/fixtures/component-annotation.vue | 14 +++++++ .../index/fixtures/component-composition.vue | 8 ++++ .../index/fixtures/component-options.vue | 14 +++++++ 4 files changed, 70 insertions(+), 4 deletions(-) create mode 100644 src/test/java/tests/de/espend/idea/vuejs/index/fixtures/component-annotation.vue create mode 100644 src/test/java/tests/de/espend/idea/vuejs/index/fixtures/component-composition.vue create mode 100644 src/test/java/tests/de/espend/idea/vuejs/index/fixtures/component-options.vue diff --git a/src/main/java/de/espend/idea/vuejs/index/ComponentUsageIndex.java b/src/main/java/de/espend/idea/vuejs/index/ComponentUsageIndex.java index 98af1f1..cdf8cd7 100644 --- a/src/main/java/de/espend/idea/vuejs/index/ComponentUsageIndex.java +++ b/src/main/java/de/espend/idea/vuejs/index/ComponentUsageIndex.java @@ -1,10 +1,18 @@ package de.espend.idea.vuejs.index; import com.intellij.lang.ecmascript6.psi.ES6ImportedBinding; +import com.intellij.lang.ecmascript6.psi.ES6Property; import com.intellij.lang.ecmascript6.resolve.JSFileReferencesUtil; +import com.intellij.lang.javascript.psi.JSExpression; +import com.intellij.lang.javascript.psi.JSObjectLiteralExpression; +import com.intellij.lang.javascript.psi.JSProperty; +import com.intellij.lang.javascript.psi.JSReferenceExpression; +import com.intellij.lang.javascript.psi.impl.JSReferenceExpressionImpl; +import com.intellij.lang.javascript.psi.util.JSStubBasedPsiTreeUtil; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiRecursiveElementVisitor; +import com.intellij.psi.util.PsiTreeUtil; import com.intellij.psi.xml.XmlTag; import com.intellij.util.PathUtil; import com.intellij.util.indexing.*; @@ -47,14 +55,36 @@ public class ComponentUsageIndex extends FileBasedIndexExtension +import ButtonCounter from './ButtonCounter.vue' + +@Component({ + components: { + ButtonCounter, + }, +}) +export default {} + + \ No newline at end of file diff --git a/src/test/java/tests/de/espend/idea/vuejs/index/fixtures/component-composition.vue b/src/test/java/tests/de/espend/idea/vuejs/index/fixtures/component-composition.vue new file mode 100644 index 0000000..e207e90 --- /dev/null +++ b/src/test/java/tests/de/espend/idea/vuejs/index/fixtures/component-composition.vue @@ -0,0 +1,8 @@ + + + \ No newline at end of file diff --git a/src/test/java/tests/de/espend/idea/vuejs/index/fixtures/component-options.vue b/src/test/java/tests/de/espend/idea/vuejs/index/fixtures/component-options.vue new file mode 100644 index 0000000..2194753 --- /dev/null +++ b/src/test/java/tests/de/espend/idea/vuejs/index/fixtures/component-options.vue @@ -0,0 +1,14 @@ + + + \ No newline at end of file