Package org.erlide.engine.model.erlang

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


    public static ErlNode createErlNode(final ErlNode parent, final IErlElement element,
            final IDocument doc) {
        int start = 0, length = 0;
        String name = element.toString();
        if (element instanceof IErlModule) {
            final IErlModule m = (IErlModule) element;
            length = doc.getLength();
            name = m.getModuleName();
        } else if (element instanceof ISourceReference) {
            final ISourceReference sourceReference = (ISourceReference) element;
            final ISourceRange sr = sourceReference.getSourceRange();
            start = sr.getOffset();
            length = sr.getLength();
View Full Code Here


        return new SourceRange(fNameRangeOffset, fNameRangeLength);
    }

    @Override
    public String getModuleName() {
        final IErlModule module = ErlangEngine.getInstance().getModelUtilService()
                .getModule(this);
        if (module != null) {
            return module.getName();
        }
        final String path = getFilePath();
        if (path != null) {
            return new Path(path).lastSegment();
        }
View Full Code Here

    public void run() {
        resetCacheForEditor(erlangEditor);
    }

    public static void resetCacheForEditor(final ErlangEditor erlangEditor) {
        final IErlModule module = erlangEditor.getModule();
        if (module == null) {
            return;
        }
        for (final String suffix : suffixes) {
            final String cacheFileOSPath = ErlangEngine.getInstance().getStateDir()
                    + module.getScannerName() + suffix;
            final File cacheFile = new File(cacheFileOSPath);
            cacheFile.delete();
        }
        erlangEditor.resetAndCacheScannerAndParser();
    }
View Full Code Here

        if (myOutlinePage != null) {
            // TODO should we use model events here?
            myOutlinePage.setInput(input);
        }
        final IErlModule module = getModule();
        if (module != null) {
            fErlangEditorErrorTickUpdater.updateEditorImage(module);
        }

        if (document != null) {
View Full Code Here

     * @return the most narrow element which includes the given offset
     * @throws ErlModelException
     */
    @Override
    public IErlElement getElementAt(final int offset, final boolean reconcile) {
        final IErlModule module = getModule();
        if (module == null) {
            return null;
        }
        try {
            if (reconcile) {
                synchronized (module) {
                    module.open(null);
                    return module.getElementAt(offset);
                }
            } else if (module.isConsistent()) {
                return module.getElementAt(offset);
            }
        } catch (final Exception e) {
        }
        return null;
    }
View Full Code Here

        super.doSave(progressMonitor);
        resetAndCacheScannerAndParser();
    }

    public void resetAndCacheScannerAndParser() {
        final IErlModule module = getModule();
        if (module == null) {
            return;
        }
        resetReconciler();
        try {
            module.createScanner();
            module.getScanner().dispose();
            module.resetAndCacheScannerAndParser(getDocument().get());
        } catch (final ErlModelException e) {
            ErlLogger.error(e);
        }
    }
View Full Code Here

    @Override
    public IErlModule findInclude(final IErlElementLocator model,
            final IErlProject project, final IErlModule module, final String includeName,
            final String includePath) throws CoreException {
        if (module != null) {
            final IErlModule include = model.findIncludeFromModule(module, includeName,
                    includePath, IErlElementLocator.Scope.REFERENCED_PROJECTS);
            if (include != null) {
                return include;
            }
        } else if (project != null) {
            final IErlModule include = model.findIncludeFromProject(project, includeName,
                    includePath, IErlElementLocator.Scope.REFERENCED_PROJECTS);
            if (include != null) {
                return include;
            }
        }
View Full Code Here

            final IErlProject project, final IErlModule module, final String moduleName0,
            final String modulePath, final ErlangFunction erlangFunction,
            final IErlElementLocator.Scope scope) throws CoreException {
        if (moduleName0 != null) {
            final String moduleName = resolveMacroValue(moduleName0, module);
            final IErlModule module2 = findModule(model, project, moduleName, modulePath,
                    scope);
            if (module2 != null) {
                module2.open(null);
                final IErlFunction function = module2.findFunction(erlangFunction);
                if (function != null) {
                    return function;
                }
                return null;
            }
View Full Code Here

    public IErlElement findTypeDef(final IErlElementLocator model,
            final IErlProject project, final IErlModule module, final String moduleName0,
            final String typeName, final String modulePath,
            final IErlElementLocator.Scope scope) throws CoreException {
        final String moduleName = resolveMacroValue(moduleName0, module);
        final IErlModule module2 = findModule(model, project, moduleName, modulePath,
                scope);
        if (module2 != null) {
            module2.open(null);
            return module2.findTypespec(typeName);
        }
        return null;
    }
View Full Code Here

    public IErlPreprocessorDef findPreprocessorDef(
            final Collection<IErlProject> projects, final String moduleName,
            final String definedName, final ErlElementKind kind) throws CoreException {
        for (final IErlProject project : projects) {
            if (project != null) {
                final IErlModule module = project.getModule(moduleName);
                if (module != null) {
                    final IErlPreprocessorDef def = findPreprocessorDef(module,
                            definedName, kind);
                    if (def != null) {
                        return def;
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.