Examples of SourceModule


Examples of org.bladerunnerjs.model.SourceModule

  private List<String> requirePaths(List<Asset> assets) {
    List<String> requirePaths = new ArrayList<>();
   
    for(Asset asset : assets) {
      SourceModule sourceModule = (SourceModule) asset;
      requirePaths.add(sourceModule.getRequirePaths().get(0));
    }
   
    return requirePaths;
  }
View Full Code Here

Examples of org.bladerunnerjs.model.SourceModule

  public CircularDependencyException(BundlableNode bundlableNode, Set<SourceModule> sourceModules) throws ModelOperationException {
    super("Circular dependency detected: " + getCircularDependency(bundlableNode, sourceModules));
  }
 
  private static String getCircularDependency(BundlableNode bundlableNode, Set<SourceModule> sourceModules) throws ModelOperationException {
    SourceModule initialSourceModule = sourceModules.iterator().next();
    ArrayList<String> dependencyChain = new ArrayList<>();
    dependencyChain.add(initialSourceModule.getPrimaryRequirePath());
    List<String> circularDependency = null;
   
    for(SourceModule sourceModule : sourceModules) {
      dependencyChain = new ArrayList<>();
      dependencyChain.add(sourceModule.getPrimaryRequirePath());
View Full Code Here

Examples of org.bladerunnerjs.model.SourceModule

  }
 
  private static List<String> traverseDependencies(BundlableNode bundlableNode, SourceModule sourceModule, Set<SourceModule> sourceModules, List<String> dependencyChain, HashSet<SourceModule> visitedSourceModules) throws ModelOperationException {
    for(Asset dependentAsset : sourceModule.getPreExportDefineTimeDependentAssets(bundlableNode)) {
      if(sourceModules.contains(dependentAsset)) {
        SourceModule dependentSourceModule = (SourceModule) dependentAsset;
        String requirePath = dependentSourceModule.getPrimaryRequirePath();
       
        if(dependencyChain.contains(requirePath)) {
          dependencyChain.add(requirePath);
          return dependencyChain.subList(dependencyChain.indexOf(requirePath), dependencyChain.size());
        }
View Full Code Here

Examples of org.eclipse.dltk.internal.core.SourceModule

        }
      }
    } else {
      IModelElement modelElement = sourceModule.getModelElement();
      if (modelElement instanceof SourceModule) {
        SourceModule sm = (SourceModule) modelElement;
        try {
          IField[] fields = sm.getFields();
          for (IField iField : fields) {
            SourceField f = (SourceField) iField;
            int fieldType = RutaParseUtils.getTypeOfIModelElement(f);
            if (RutaTypeConstants.RUTA_TYPE_N == type) {
              if (fieldType == RutaTypeConstants.RUTA_TYPE_N
View Full Code Here

Examples of org.eclipse.dltk.internal.core.SourceModule

        }
      }
    } else {
      IModelElement modelElement = sourceModule.getModelElement();
      if (modelElement instanceof SourceModule) {
        SourceModule sm = (SourceModule) modelElement;
        try {
          IField[] fields = sm.getFields();
          for (IField iField : fields) {
            SourceField f = (SourceField) iField;
            int fieldType = RutaParseUtils.getTypeOfIModelElement(f);
            if (RutaTypeConstants.RUTA_TYPE_N == type) {
              if (fieldType == RutaTypeConstants.RUTA_TYPE_N || fieldType == RutaTypeConstants.RUTA_TYPE_I
View Full Code Here

Examples of org.eclipse.dltk.internal.core.SourceModule

    // if the php files are the direct children of a project,
    // even when they are selected,but they will not choosen by default,
    // so make the parent of these php files is ScriptProject instead of
    // ScriptFolder is ok
    if (element instanceof SourceModule && parent instanceof ScriptFolder) {
      SourceModule sourceModule = (SourceModule) element;
      ScriptFolder scriptFolder = (ScriptFolder) parent;
      if (scriptFolder.getPath().segmentCount() == 1) {
        parent = sourceModule.getScriptProject();
        // element = sourceModule.getResource();
      }
    }
    fCurrentTreeSelection = parent;
    // As this is not done from the UI then set the box for updating from
View Full Code Here

Examples of org.python.pydev.editor.codecompletion.revisited.modules.SourceModule

                                                    true);
                                        }
                                    }
                                }
                                if (module instanceof SourceModule) {
                                    SourceModule sourceModule = (SourceModule) module;

                                    OutlineCreatorVisitor visitor = OutlineCreatorVisitor.create(sourceModule.getAst());
                                    ParsedItem root = new ParsedItem(visitor.getAll().toArray(
                                            new ASTEntryWithChildren[0]), null);
                                    childrenToReturn = getChildrenFromParsedItem(wrappedResourceParent, root, file);
                                }
                            }
View Full Code Here

Examples of org.python.pydev.editor.codecompletion.revisited.modules.SourceModule

                try {
                    AbstractModule mod = AbstractModule.createModule(key.name, key.file, info.nature, true);
                    if (!(mod instanceof SourceModule)) {
                        continue;
                    }
                    SourceModule module = (SourceModule) mod;
                    if (module == null || module.getAst() == null) {
                        buffer.append(com.aptana.shared_core.string.StringUtils.format(
                                "Warning: cannot parse: %s - %s (so, it's ok not having additional info on it)\n",
                                key.name, key.file));
                    } else {
                        try {
                            Iterator<ASTEntry> innerEntriesForAST = AbstractAdditionalDependencyInfo
                                    .getInnerEntriesForAST(module.getAst()).o2;
                            if (innerEntriesForAST.hasNext()) {
                                info.allOk = false;
                                info.moduleNotInAdditionalInfo.add(module);
                                buffer.append(com.aptana.shared_core.string.StringUtils.format(
                                        "The additional info index of the module: %s is not updated.\n", key.name));
View Full Code Here

Examples of org.python.pydev.editor.codecompletion.revisited.modules.SourceModule

        }

        //Put things from the memo to final variables as we might need them later on and we cannot get them from
        //the memo later.
        final String moduleName;
        final SourceModule module;
        final IDocument doc;
        try {
            doc = document.call();
            if (doc == null) {
                return;
            }

            moduleName = getModuleName(resource, nature);
            module = getSourceModule(resource, doc, nature);
        } catch (MisconfigurationException e) {
            Log.log(e);
            return;
        }

        //depending on the level of analysis we have to do, we'll decide whether we want
        //to make the full parse (slower) or the definitions parse (faster but only with info
        //related to the definitions)
        ICallback<IModule, Integer> moduleCallback = new ICallback<IModule, Integer>() {

            public IModule call(Integer arg) {

                //Note: we cannot get anything from the memo at this point because it'll be called later on from a thread
                //and the memo might have changed already (E.g: moduleName and module)

                if (arg == IAnalysisBuilderRunnable.FULL_MODULE) {
                    if (module != null) {
                        return module;
                    } else {
                        try {
                            return createSoureModule(resource, doc, moduleName);
                        } catch (MisconfigurationException e) {
                            throw new RuntimeException(e);
                        }
                    }

                } else if (arg == IAnalysisBuilderRunnable.DEFINITIONS_MODULE) {
                    if (DebugSettings.DEBUG_ANALYSIS_REQUESTS) {
                        Log.toLogFile(this, "PyDevBuilderPrefPage.getAnalyzeOnlyActiveEditor()");
                    }
                    IFile f = (IFile) resource;
                    String file = f.getRawLocation().toOSString();
                    return new SourceModule(moduleName, new File(file), FastDefinitionsParser.parse(doc.get(),
                            moduleName), null);

                } else {
                    throw new RuntimeException("Unexpected parameter: " + arg);
                }
View Full Code Here

Examples of org.python.pydev.editor.codecompletion.revisited.modules.SourceModule

                return "None";
            }
            //Only mark it as found if we were able to get the python nature (otherwise, this could change later
            //if requesting during a setup)
            if (nature.startRequests()) { //start requests, as we'll ask for resolve and get module.
                SourceModule sourceModule = null;
                try {
                    String modName = nature.resolveModule(fileStr);
                    if (modName != null) {
                        //when all is set up, this is the most likely path we're going to use
                        //so, we shouldn't have delays when the module is changed, as it's already
                        //ok for use.
                        IModule module = astManager.getModule(modName, nature, true);
                        if (module instanceof SourceModule) {
                            sourceModule = (SourceModule) module;
                        }
                    }
                } finally {
                    nature.endRequests();
                }
                lastModifiedTimeCached = file.lastModified();

                if (sourceModule == null) {
                    //the text for the breakpoint requires the function name, and it may be requested before
                    //the ast manager is actually restored (so, modName is None, and we have little alternative
                    //but making a parse to get the function name)
                    IDocument doc = getDocument();
                    sourceModule = (SourceModule) AbstractModule.createModuleFromDoc("", null, doc, nature, true);
                }

                int lineToUse = getLineNumber() - 1;

                if (sourceModule == null || sourceModule.getAst() == null || lineToUse < 0) {
                    functionName = "None";
                    return functionName;
                }

                SimpleNode ast = sourceModule.getAst();

                functionName = NodeUtils.getContextName(lineToUse, ast);
                if (functionName == null) {
                    functionName = ""; //global context
                }
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.