diff --git a/src/main/java/de/espend/idea/laravel/ReferenceResolver2.java b/src/main/java/de/espend/idea/laravel/ReferenceResolver2.java new file mode 100644 index 0000000..8b6154c --- /dev/null +++ b/src/main/java/de/espend/idea/laravel/ReferenceResolver2.java @@ -0,0 +1,22 @@ +package de.espend.idea.laravel; + +import com.jetbrains.php.lang.psi.elements.PhpNamedElement; +import com.jetbrains.php.lang.psi.elements.PhpReference; +import com.jetbrains.php.lang.psi.resolve.PhpReferenceResolver2; + +import java.util.Collection; +import java.util.Collections; + +@SuppressWarnings("UnstableApiUsage") +public class ReferenceResolver2 implements PhpReferenceResolver2 { + @Override + public Collection resolve(PhpReference phpReference, Collection candidates) { + if (candidates.size()>1) { + for (PhpNamedElement element : candidates) { + if (element.getContainingFile().getVirtualFile().getName().equals("_ide_helper.php")) + return Collections.singleton(element); + } + } + return candidates; + } +} diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 67d1095..e7df4b1 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -80,6 +80,7 @@ +