Package org.angularjs.codeInsight.refs

Source Code of org.angularjs.codeInsight.refs.AngularJSTemplateReferencesProvider

package org.angularjs.codeInsight.refs;

import com.intellij.lang.javascript.psi.JSLiteralExpression;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiReference;
import com.intellij.psi.PsiReferenceProvider;
import com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReferenceSet;
import com.intellij.util.ArrayUtil;
import com.intellij.util.ProcessingContext;
import org.jetbrains.annotations.NotNull;

/**
* @author Dennis.Ushakov
*/
public class AngularJSTemplateReferencesProvider extends PsiReferenceProvider {
  @NotNull
  @Override
  public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) {
    final FileReferenceSet fileReferenceSet = new FileReferenceSet(element) {
      @Override
      protected boolean isSoft() {
        return true;
      }
    };
    return ArrayUtil.mergeArrays(fileReferenceSet.getAllReferences(),
                                 new PsiReference[] {new AngularJSTemplateCacheReference((JSLiteralExpression)element)});
  }
}
TOP

Related Classes of org.angularjs.codeInsight.refs.AngularJSTemplateReferencesProvider

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.