Package org.erlide.engine.model.erlang

Examples of org.erlide.engine.model.erlang.IErlModule


        }
    }

    static void addFileToScope(final IFile file, final ErlSearchScope result) {
        if (SourceKind.hasModuleExtension(file.getName())) {
            final IErlModule module = ErlangEngine.getInstance().getModel()
                    .findModule(file);
            result.addModule(module);
        }
    }
View Full Code Here


                            }
                        }
                        theExternal.open(null);
                    }
                    if (theElement instanceof IErlModule) {
                        final IErlModule module = (IErlModule) theElement;
                        if (externalModulePaths.add(module.getFilePath())) {
                            result.addModule(module);
                        }
                    }
                    return true;
                }
View Full Code Here

    private void completionTest(final IErlProject project, final String name,
            final String text, final int offset, final List<String> expected,
            final boolean inStrings) throws CoreException {
        final IDocument document = new StringDocument(text);
        final IErlModule module = createModule(project, name, text);
        module.open(null);

        final MockSourceViewer sourceViewer = new MockSourceViewer(document, offset);
        final IContentAssistProcessor p = inStrings ? new ErlStringContentAssistProcessor(
                sourceViewer, module, project, null) : new ErlContentAssistProcessor(
                sourceViewer, module, project, null);
View Full Code Here

    return new Match(ese, _offset, _length);
  }
 
  public static ErlangSearchElement createSearchElementFromRef(final ModuleLineFunctionArityRef ref, final Map<String, IErlModule> pathToModuleMap) {
    String _modulePath = ref.getModulePath();
    final IErlModule module = pathToModuleMap.get(_modulePath);
    return SearchUtil.createSearchElement(ref, module);
  }
View Full Code Here

        final String moduleName = modelFindService.resolveMacroValue(moduleName0, module);
        // we have an external call
        final List<ICompletionProposal> result = new ArrayList<ICompletionProposal>();
        final boolean checkAllProjects = NavigationPreferencePage.getCheckAllProjects();
        final IErlElementLocator model = ErlangEngine.getInstance().getModel();
        final IErlModule theModule = modelFindService.findModule(model, project,
                moduleName, null,
                checkAllProjects ? IErlElementLocator.Scope.ALL_PROJECTS
                        : IErlElementLocator.Scope.REFERENCED_PROJECTS);
        if (theModule != null) {
            if (ErlangEngine.getInstance().getModelUtilService().isOtpModule(theModule)) {
View Full Code Here

            final int offset = selection.getOffset();
            ITextEditor textEditor = null;
            OpenResult openResult = null;
            IErlElement element = null;
            IErlProject project = null;
            IErlModule module = null;
            final IErlModel model = ErlangEngine.getInstance().getModel();
            if (activeEditor instanceof AbstractErlangEditor) {
                final AbstractErlangEditor editor = (AbstractErlangEditor) activeEditor;
                textEditor = editor;
                editor.reconcileNow();
                final String scannerName = editor.getScannerName();
                module = editor.getModule();
                project = editor.getProject();
                openResult = ErlangEngine
                        .getInstance()
                        .getService(OpenService.class)
                        .open(scannerName,
                                offset,
                                ErlangEngine.getInstance().getModelUtilService()
                                        .getImportsAsList(module),
                                project.getProperties().getExternalModules(),
                                model.getPathVars(module.getCorrespondingResource()));
                ErlLogger.debug("open " + openResult);
                element = editor.getElementAt(offset, true);
            } else if (activeEditor instanceof ITextEditor) {
                textEditor = (ITextEditor) activeEditor;
                final String text = textEditor.getDocumentProvider()
View Full Code Here

            editedModulesMap.put(path, module);
        }
    }

    public IErlModule getModuleByPath(final String path) {
        final IErlModule module = editedModulesMap.get(path);
        if (module != null) {
            return module;
        }
        return pathToModuleCache.getIfPresent(path);
    }
View Full Code Here

        // Which is hard, since the IOldErlangProjectProperties doesn't have
        // listeners
        @Override
        public void elementChanged(final IErlElement element) {
            if (element instanceof IErlModule) {
                final IErlModule module = (IErlModule) element;
                moduleIncludeCache.invalidate(module);
            }
        }
View Full Code Here

                }
                return new StructuredSelection(file);
            }
        } else {
            try {
                final IErlModule module = ErlModelUtils.getModule(input);
                if (module != null) {
                    final IResource resource = module.getCorrespondingResource();
                    if (resource != null) {
                        return new StructuredSelection(resource);
                    }
                    return new StructuredSelection(module);
                }
View Full Code Here

    }

    public static void addDialyzerWarningMarker(final IErlElementLocator model,
            final String path, final int line, final String message) {
        IResource resource = null;
        IErlModule module = null;
        try {
            if (SourceKind.hasHrlExtension(path)) {
                module = model.findInclude(null, path);
            } else {
                module = model.findModule(null, path);
            }
            if (module != null) {
                resource = module.getResource();
            }
        } catch (final Exception e) {
            ErlLogger.error(e);
        }
View Full Code Here

TOP

Related Classes of org.erlide.engine.model.erlang.IErlModule

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.