Examples of PsiReference


Examples of com.intellij.psi.PsiReference

    element = (element != null) ? element.getParent() : null;
    final List<PsiElement> usages = new ArrayList<PsiElement>();
    if (element instanceof Symbol) {
//      usages.add(element);

      final PsiReference ref = element.getReference();
      if (ref != null) {
        final PsiElement resolve = ref.resolve();
        if (resolve != null && resolve instanceof Symbol) {
          if (!resolve.equals(element))
            usages.add(resolve);
          final Collection<Symbol> symbolsInFile = PsiTreeUtil.findChildrenOfType(psiFile, Symbol.class);
          for (Symbol symbol : symbolsInFile) {
            final PsiReference reference = symbol.getReference();
            if (reference != null) {
              final PsiElement resolve1 = reference.resolve();
              if (resolve1 != null && !symbol.equals(resolve1) && resolve.equals(resolve1)) {
                usages.add(symbol);
              }
            }
          }
View Full Code Here

Examples of com.intellij.psi.PsiReference

    final Collection<PsiReference> usages = new HashSet<PsiReference>();
    if (target instanceof Symbol) {
//      usages.add(element);

      final PsiReference ref = target.getReference();
      if (ref != null) {
        usages.add(ref);
        final PsiElement resolve = ref.resolve();
        if (resolve != null && resolve instanceof Symbol) {
          final Collection<Symbol> symbolsInFile = PsiTreeUtil.findChildrenOfType(target.getContainingFile(), Symbol.class);
          for (Symbol symbol : symbolsInFile) {
            final PsiReference reference = symbol.getReference();
            if (reference != null) {
              final PsiElement resolve1 = reference.resolve();
              if (resolve1 != null && !symbol.equals(resolve1) && resolve.equals(resolve1)) {
                usages.add(reference);
              }
            }
          }
View Full Code Here

Examples of com.intellij.psi.PsiReference

                    break;
                LineCol refLineCol = LineCol.parse(srcLineCol);
                String srcModule = bf.readLine();
                if (srcModule != null) {
                    PsiElement elementAt = HPIdentImpl.getElementAt(project, new DeclarationPosition(refLineCol, srcModule));
                    PsiReference reference = elementAt.getReference();
                    consumer.process(reference);
                }
            }
        } catch (Exception e) {
            LOG.error(e);
View Full Code Here

Examples of com.intellij.psi.PsiReference

      addImportForLookupElement(context, item, context.getTailOffset() - 1);
    }
  };

  private static void addImportForLookupElement(final InsertionContext context, final LookupElement item, final int tailOffset) {
    final PsiReference ref = context.getFile().findReferenceAt(tailOffset);
    if (ref == null || ref.resolve() != null) {
      // no import statement needed
      return;
    }
    new WriteCommandAction(context.getProject(), context.getFile()) {
      @Override
View Full Code Here

Examples of com.intellij.psi.PsiReference

  @Override
  public HaxeNamedComponent getTypeComponent() {
    final HaxeTypeTag typeTag = PsiTreeUtil.getChildOfType(getParent(), HaxeTypeTag.class);
    final HaxeType type = typeTag == null ? null : typeTag.getTypeOrAnonymous().getType();
    final PsiReference reference = type == null ? null : type.getReference();
    if (reference != null) {
      final PsiElement result = reference.resolve();
      if (result instanceof HaxeNamedComponent) {
        return (HaxeNamedComponent)result;
      }
    }
    return null;
View Full Code Here

Examples of com.intellij.psi.PsiReference

                            filepath = viewAbsolutePath + "/" + uri.replace("//", "");
                        }
                        VirtualFile viewfile = baseDir.findFileByRelativePath(filepath);

                        if (viewfile != null && appDir != null) {
                            PsiReference ref = new FileReference(
                                    viewfile,
                                    uri,
                                    element,
                                    new TextRange(start, start + len),
                                    project,
View Full Code Here

Examples of com.intellij.psi.PsiReference

                    int start = textRange.getStartOffset();
                    int len = textRange.getLength();

                    //System.out.println("Temp pour int : " + (System.nanoTime() - startTime) / 1000000 + " ms");

                    PsiReference ref = new FileReference(file, uri, element,
                            new TextRange(start, start + len), YiiPsiReferenceProvider.project, protectedPathDir, protectedPathDir);
                    return new PsiReference[]{ref};
                }
            }
View Full Code Here

Examples of com.intellij.psi.PsiReference

                        String className = element.getText();
                        VirtualFile v = ARRelationReferenceProvider.getClassFile(className);
                        VirtualFile appDir = baseDir.findFileByRelativePath(viewPath);
                        VirtualFile protectedPathDir = (!protectedPath.equals("")) ? baseDir.findFileByRelativePath(protectedPath) : null;
                        if (appDir != null) {
                            PsiReference ref = new FileReference(v, str.substring(textRange.getStartOffset(), textRange.getEndOffset())
                                    , element,
                                    textRange, YiiPsiReferenceProvider.project, protectedPathDir, appDir);
                            return new PsiReference[]{ref};
                        }
                    }
View Full Code Here

Examples of com.intellij.psi.PsiReference

            try {
                String relativePath = protectedPath + "/" + searchString + ".php";
                VirtualFile viewfile = project.getBaseDir().findFileByRelativePath(relativePath);

                if (viewfile != null) {
                    PsiReference ref = new I18nFileReference(
                            viewfile,
                            element,
                            element.getTextRange(),
                            project);
                    return new PsiReference[]{ref};
View Full Code Here

Examples of com.intellij.psi.PsiReference

                    filepath = viewAbsolutePath + "/" + uri.replace("//", "");
                }
                VirtualFile file = baseDir.findFileByRelativePath(filepath);

                if (file != null && appDir != null) {
                    PsiReference ref = new FileReference(file, uri, element,
                            new TextRange(start, start + len), YiiPsiReferenceProvider.project, protectedPathDir, appDir);
                    return new PsiReference[]{ref};
                }
            }
            return PsiReference.EMPTY_ARRAY;
View Full Code Here
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.