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

Examples of org.jetbrains.plugins.clojure.psi.api.ns.ClNs


  @Nullable
  public static ClSyntheticNamespace getNamespace(@NotNull String fqn, @NotNull final Project project) {
    final Collection<ClNs> nsWithPrefix = StubIndex.getInstance().get(ClojureNsNameIndex.KEY, fqn, project, GlobalSearchScope.allScope(project));
    if (!nsWithPrefix.isEmpty()) {
      final ClNs ns = nsWithPrefix.iterator().next();
      final String nsName = ns.getName();
      assert nsName != null;
      final String synthName = nsName.equals(fqn) ? nsName : fqn;
      final String refName = StringUtil.getShortName(synthName);

      ClNs navigationElement = null;
      for (ClNs clNs : nsWithPrefix) {
        if (fqn.equals(clNs.getName())) {
          navigationElement = clNs;
        }
      }
View Full Code Here


    return ((ClNs) ClojurePsiUtil.findFormByNameSet(this, ClojureParser.NS_TOKENS));
  }

  @NotNull
  public ClNs findOrCreateNamespaceElement() throws IncorrectOperationException {
    final ClNs ns = getNamespaceElement();
    if (ns != null) return ns;
    commitDocument();
    final ClojurePsiFactory factory = ClojurePsiFactory.getInstance(getProject());
    final ClList nsList = factory.createListFromText(ListDeclarations.NS + " " + getName());
    final PsiElement anchor = getFirstChild();
View Full Code Here

      // todo test me!!
      final PsiClass clazz = (PsiClass) element;
      final Application application = ApplicationManager.getApplication();
      application.runWriteAction(new Runnable() {
        public void run() {
          final ClNs ns = ((ClojureFile) file).findOrCreateNamespaceElement();
          ns.addImportForClass(ClSymbolImpl.this, clazz);
        }
      });
      return this;
    }
    return this;
View Full Code Here

TOP

Related Classes of org.jetbrains.plugins.clojure.psi.api.ns.ClNs

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.