use of org.erlide.engine.model.root.IErlModule in project erlide_eclipse by erlang.
the class IErlFolderTest method findInclude.
// IErlModule findInclude(String includeName, String includePath)
// throws ErlModelException;
@Test
public void findInclude() throws Exception {
final IErlModule include = ErlideTestUtils.createInclude(project, "yy.hrl", "-define(ME, yy).\n");
final IErlModule module2 = ErlideTestUtils.createInclude(project, "zz.erl", "-module(zz).\n");
final String moduleName = include.getModuleName();
final String name = include.getName();
final String filePath = include.getFilePath();
final IErlModule findInclude = srcFolder.findInclude(moduleName, null);
final IErlModule findInclude2 = includeFolder.findInclude(moduleName, null);
final IErlModule findInclude3 = includeFolder.findInclude(null, filePath);
final IErlModule findInclude4 = includeFolder.findInclude(name, null);
final IErlModule findInclude5 = includeFolder.findInclude("xxaa", filePath);
final IErlModule findInclude6 = includeFolder.findInclude("zz.erl", null);
final IErlModule findInclude7 = includeFolder.findInclude("zz", null);
assertNull(findInclude);
assertEquals(include, findInclude2);
assertEquals(include, findInclude3);
assertEquals(include, findInclude4);
assertEquals(include, findInclude5);
assertEquals(module2, findInclude6);
assertNull(findInclude7);
}
use of org.erlide.engine.model.root.IErlModule in project erlide_eclipse by erlang.
the class ErlangEditor method setSelection.
public void setSelection(final IErlElement element) {
if (element == null || element instanceof IErlModule) {
return;
}
if (element instanceof ISourceReference) {
final ISourceReference reference = (ISourceReference) element;
// set highlight range
setSelection(reference, true);
if (myOutlinePage != null) {
myOutlinePage.select(reference);
}
}
}
use of org.erlide.engine.model.root.IErlModule in project erlide_eclipse by erlang.
the class ErlangSourceViewerConfiguration method getReconciler.
@Override
public IReconciler getReconciler(final ISourceViewer sourceViewer) {
final ErlReconcilingStrategy strategy = new ErlReconcilingStrategy(null);
final IErlModule module = null;
final String path = null;
final ErlReconciler reconciler = new ErlReconciler(strategy, true, true, path, module, null);
reconciler.setProgressMonitor(new NullProgressMonitor());
reconciler.setIsAllowedToModifyDocument(false);
reconciler.setDelay(500);
return reconciler;
}
use of org.erlide.engine.model.root.IErlModule in project erlide_eclipse by erlang.
the class ErlangQuickFixCollector method getFixes.
public IMarkerResolution[] getFixes(final IMarker marker) {
final IResource resource = marker.getResource();
final IErlModel model = ErlangEngine.getInstance().getModel();
IErlModule module;
if (resource == null) {
return new IMarkerResolution[0];
}
if (resource instanceof IProject) {
return getFixesForProject((IProject) resource, marker);
}
if (resource instanceof IFile) {
module = model.findModule((IFile) resource);
if (module != null) {
return getFixesForModule(module, marker);
}
}
return new IMarkerResolution[0];
}
use of org.erlide.engine.model.root.IErlModule in project erlide_eclipse by erlang.
the class ClearCacheAction method resetCacheForEditor.
public static void resetCacheForEditor(final ErlangEditor erlangEditor) {
final IErlModule module = erlangEditor.getModule();
if (module == null) {
return;
}
for (final String suffix : ClearCacheAction.suffixes) {
final String cacheFileOSPath = ErlangEngine.getInstance().getStateDir() + module.getScannerName() + suffix;
final File cacheFile = new File(cacheFileOSPath);
cacheFile.delete();
}
erlangEditor.resetAndCacheScannerAndParser();
}
Aggregations