Package org.intellij.erlang.sdk

Examples of org.intellij.erlang.sdk.ErlangSdkRelease


      List<LookupElement> lookupElements = ContainerUtil.newArrayList();

      Module module = ModuleUtilCore.findModuleForPsiElement(containingFile);
      Sdk sdk = module == null ? null : ModuleRootManager.getInstance(module).getSdk();
      ErlangSdkRelease release = sdk != null ? ErlangSdkType.getRelease(sdk) : null;
      if (qAtom != null) {
        String moduleName = getName(qAtom);
        functions.addAll(getExternalFunctionForCompletion(containingFile.getProject(), moduleName));

        if (release == null || release.needBifCompletion(moduleName)) {
          addBifs(lookupElements, ErlangBifTable.getBifs(moduleName), withArity);
        }
        addBifs(lookupElements, ErlangBifTable.getBifs("", ErlangBifTable.MODULE_INFO), withArity);
      }
      else {
        ErlangFile erlangFile = (ErlangFile) containingFile;
        functions.addAll(erlangFile.getFunctions());
        functions.addAll(getExternalFunctionForCompletion(containingFile.getProject(), "erlang"));

        for (ErlangImportFunction importFunction : erlangFile.getImportedFunctions()) {
          lookupElements.add(createFunctionLookupElement(importFunction.getQAtom().getText(), getArity(importFunction.getInteger()), withArity, ErlangCompletionContributor.MODULE_FUNCTIONS_PRIORITY));
        }

        if (!withArity && (release == null || release.needBifCompletion("erlang"))) {
          addBifs(lookupElements, ErlangBifTable.getBifs("erlang"));
        }
        if (!withArity && (release == null || release.needBifCompletion(""))) {
          addBifs(lookupElements, ErlangBifTable.getBifs(""));
        }
      }

      functions.addAll(getErlangFunctionsFromIncludes((ErlangFile) containingFile, true, "", 0));
View Full Code Here


public class ErlangR17SyntaxInspection extends ErlangInspectionBase {
  @Override
  protected boolean canRunOn(@NotNull ErlangFile file) {
    Module module = ModuleUtilCore.findModuleForPsiElement(file);
    Sdk sdk = module == null ? null : ModuleRootManager.getInstance(module).getSdk();
    ErlangSdkRelease release = sdk != null ? ErlangSdkType.getRelease(sdk) : null;
    return release == null || !release.isNewerThan(ErlangSdkRelease.R17);
  }
View Full Code Here

      ErlangFunction implicitFunction = getExternalFunction("erlang");
      if (implicitFunction != null) return implicitFunction;

      Module module = ModuleUtilCore.findModuleForPsiElement(erlangFile);
      Sdk sdk = module == null ? null : ModuleRootManager.getInstance(module).getSdk();
      ErlangSdkRelease release = sdk != null ? ErlangSdkType.getRelease(sdk) : null;

      if ((release == null || release.needBifCompletion("erlang")) && ErlangBifTable.isBif("erlang", myReferenceName, myArity)) {
        return getElement();
      }

      if (ErlangBifTable.isBif("", myReferenceName, myArity)) {
        return getElement();
View Full Code Here

TOP

Related Classes of org.intellij.erlang.sdk.ErlangSdkRelease

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.