Search in sources :

Example 16 with FileReferenceSet

use of com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReferenceSet in project intellij-plugins by JetBrains.

the class FreeMarkerStrutsResultContributor method createReferences.

public boolean createReferences(@NotNull final PsiElement psiElement, @NotNull final List<PsiReference> references, final boolean soft) {
    final String namespace = getNamespace(psiElement);
    if (namespace == null) {
        return false;
    }
    final FileReferenceSet set = FileReferenceSetHelper.createRestrictedByFileType(psiElement, FtlFileType.INSTANCE);
    final WebFacet webFacet = WebUtil.getWebFacet(psiElement);
    if (webFacet != null) {
        FileReferenceSetHelper.addWebDirectoryAndCurrentNamespaceAsRoots(psiElement, namespace, webFacet, set);
    }
    set.setEmptyPathAllowed(false);
    Collections.addAll(references, set.getAllReferences());
    return true;
}
Also used : FileReferenceSet(com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReferenceSet) WebFacet(com.intellij.javaee.web.facet.WebFacet)

Aggregations

FileReferenceSet (com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReferenceSet)16 NotNull (org.jetbrains.annotations.NotNull)8 VirtualFile (com.intellij.openapi.vfs.VirtualFile)6 WebFacet (com.intellij.javaee.web.facet.WebFacet)3 TextRange (com.intellij.openapi.util.TextRange)3 FileReference (com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReference)3 IncorrectOperationException (com.intellij.util.IncorrectOperationException)3 ProcessingContext (com.intellij.util.ProcessingContext)3 ArrayList (java.util.ArrayList)3 FileType (com.intellij.openapi.fileTypes.FileType)2 Module (com.intellij.openapi.module.Module)2 Condition (com.intellij.openapi.util.Condition)2 com.intellij.psi (com.intellij.psi)2 Collection (java.util.Collection)2 Collections (java.util.Collections)2 List (java.util.List)2 GoGetPackageFix (com.goide.codeInsight.imports.GoGetPackageFix)1 GoDeleteImportQuickFix (com.goide.quickfix.GoDeleteImportQuickFix)1 RenameFileFix (com.intellij.codeInsight.daemon.impl.quickfix.RenameFileFix)1 CreateFileFix (com.intellij.codeInsight.daemon.quickFix.CreateFileFix)1