Package org.jetbrains.plugins.clojure.psi.api.symbols

Examples of org.jetbrains.plugins.clojure.psi.api.symbols.ClSymbol


      return results.toArray(new ClojureResolveResult[results.size()]);
    }

    private void resolveImpl(ClSymbol symbol, ResolveProcessor processor) {
      final ClSymbol qualifier = symbol.getQualifierSymbol();

      //process other places
      if (qualifier == null) {
        ResolveUtil.treeWalkUp(symbol, processor);
      } else {
        for (ResolveResult result : qualifier.multiResolve(false)) {
          final PsiElement element = result.getElement();
          if (element != null) {
            final PsiElement sep = symbol.getSeparatorToken();
            if (sep != null && "/".equals(sep.getText())) {
View Full Code Here


        final PsiElement parent = element.getParent();
        if (parent instanceof ClojureFile) {
          while (element != null) {
            if (element instanceof ClList) {
              ClList list = (ClList) element;
              final ClSymbol first = list.getFirstSymbol();
              if (first != null && first.getText().equals("ns")) {
                final ClSymbol snd = PsiTreeUtil.getNextSiblingOfType(first, ClSymbol.class);
                if (snd != null) {
                  stringRef.set(snd.getText());
                  return;
                }
              }
            }
            element = element.getPrevSibling();
View Full Code Here

      if (!checkRequireQualifier(processor, place, child, ((ClSymbol) stmt).getNameString())) return false;
    } else if (stmt instanceof ClVector && isSpecialVector((ClVector) stmt, ClojureKeywords.AS)) {
      ClVector vector = (ClVector) stmt;
      final ClSymbol[] symbols = vector.getAllSymbols();
      if (symbols.length > 0) {
        final ClSymbol symbol = symbols[0];
        if (!processVectorAliasSymbols(processor, vector, symbol)) return false;
        if (!checkRequireQualifier(processor, place, child, symbol.getNameString())) {
          return false;
        }
      }
    } else if (stmt instanceof ClVector || stmt instanceof ClList) {
      final ClListLike listLike = (ClListLike) stmt;
View Full Code Here

      if (!checkReferQualifier(processor, place, child, ((ClSymbol) stmt).getNameString(), new ReferFilter())) return false;
    } else if (stmt instanceof ClVector && isSpecialVector((ClVector) stmt)) {
      ClVector vector = (ClVector) stmt;
      final ClSymbol[] symbols = vector.getAllSymbols();
      if (symbols.length > 0) {
        final ClSymbol symbol = symbols[0];
        final ReferFilter referFilter = collectReferFilter(vector, symbol);
        if (!checkReferQualifier(processor, place, child, symbol.getNameString(), referFilter)) {
          return false;
        }
      }
    } else if (stmt instanceof ClVector || stmt instanceof ClList) {
      final ClListLike listLike = (ClListLike) stmt;
View Full Code Here

    final PsiElement fst = listLike.getFirstNonLeafElement();
    if (fst instanceof ClSymbol) {
      PsiElement next = fst.getNextSibling();
      while (next != null) {
        if (next instanceof ClSymbol) {
          ClSymbol clazzSym = (ClSymbol) next;
          qualifiedNames.add(((ClSymbol) fst).getNameString() + "." + clazzSym.getNameString());
        }
        next = next.getNextSibling();
      }
    }
    return qualifiedNames;
View Full Code Here

    final PsiElement fst = listLike.getFirstNonLeafElement();
    if (fst instanceof ClSymbol) {
      PsiElement next = fst.getNextSibling();
      while (next != null) {
        if (next instanceof ClSymbol) {
          ClSymbol clazzSym = (ClSymbol) next;
          if (!checkRequireQualifier(processor, place, child, ((ClSymbol) fst).getNameString() + "." + clazzSym.getNameString())) {
            return false;
          }
        } else if (next instanceof ClVector) {
          ClVector vector = (ClVector) next;
          final ClSymbol[] symbols = vector.getAllSymbols();
          if (symbols.length > 0) {
            final ClSymbol symbol = symbols[0];
            if (isSpecialVector((ClVector) next, ClojureKeywords.AS) &&
                !processVectorAliasSymbols(processor, vector, symbol)) return false;
            if (!checkRequireQualifier(processor, place, child,
                ((ClSymbol) fst).getNameString() + "." + symbol.getNameString())) {
              return false;
            }
          }
        }
        next = next.getNextSibling();
View Full Code Here

      PsiElement next = fst.getNextSibling();
      boolean isSimple = true;
      while (next != null) {
        if (next instanceof ClSymbol) {
          isSimple = false;
          ClSymbol clazzSym = (ClSymbol) next;
          if (!checkReferQualifier(processor, place, child, ((ClSymbol) fst).getNameString() + "." + clazzSym.getNameString(), new ReferFilter())) {
            return false;
          }
        } else if (next instanceof ClVector) {
          isSimple = false;
          ClVector vector = (ClVector) next;
          final ClSymbol[] symbols = vector.getAllSymbols();
          if (symbols.length > 0) {
            final ClSymbol symbol = symbols[0];
            ReferFilter filter = collectReferFilter(vector, symbol);
            if (!checkReferQualifier(processor, place, child,
                ((ClSymbol) fst).getNameString() + "." + symbol.getNameString(), filter)) {
              return false;
            }
          }
        }
View Full Code Here

    }

    public String accept(String name) {
      if (excludes.contains(name)) return null;
      if (!only.isEmpty() && !only.contains(name)) return null;
      final ClSymbol symbol = renames.get(name);
      return symbol == null ? name : symbol.getNameString();
    }
View Full Code Here

  /**
   * @return Name of string symbol defined
   */
  @Nullable
  public ClSymbol getNameSymbol() {
    final ClSymbol first = findChildByClass(ClSymbol.class);
    if (first == null) return null;
    return PsiTreeUtil.getNextSiblingOfType(first, ClSymbol.class);
  }
View Full Code Here

    if (first == null) return null;
    return PsiTreeUtil.getNextSiblingOfType(first, ClSymbol.class);
  }

  public String getDefinedName() {
    ClSymbol sym = getNameSymbol();
    if (sym != null) {
      String name = sym.getText();
      assert name != null;
      return name;
    }
    return "";
  }
View Full Code Here

TOP

Related Classes of org.jetbrains.plugins.clojure.psi.api.symbols.ClSymbol

Copyright © 2018 www.massapicom. 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.