public static void addDialyzerWarningMarkersFromResultList( final IErlProject project, final Backend backend, final OtpErlangList result) { if (result == null) { return; } final IProject p = project.getProject(); for (final OtpErlangObject i : result) { final OtpErlangTuple t = (OtpErlangTuple) i; final OtpErlangTuple fileLine = (OtpErlangTuple) t.elementAt(1); final String filename = Util.stringValue(fileLine.elementAt(0)); final OtpErlangLong lineL = (OtpErlangLong) fileLine.elementAt(1); int line = 1; try { line = lineL.intValue(); } catch (final OtpErlangRangeException e) { ErlLogger.error(e); } String s = ErlideDialyze.formatWarning(backend, t).trim(); final int j = s.indexOf(": "); if (j != -1) { s = s.substring(j + 1); } addDialyzerWarningMarker(p, filename, line, s); } }
public static void removeDialyzerWarningMarkers(final IProject project) { try { final IMarker[] markers = project.findMarkers(DIALYZE_WARNING_MARKER, true, IResource.DEPTH_INFINITE); for (final IMarker m : markers) { m.delete(); } } catch (final CoreException e) { ErlLogger.error(e); } }
/* * (non-Javadoc) Method declared on SelectionDispatchAction. */ @Override public void run(final IStructuredSelection selection) { if (!checkEnabled(selection)) { return; } for (final Object i : selection.toArray()) { if (i instanceof IErlElement) { try { ErlModelUtils.openElement((IErlElement) i); } catch (final CoreException e) { ErlLogger.error(e); } } } }