use of org.erlide.cover.views.model.LineResult in project erlide_eclipse by erlang.
the class EditorTracker method addAnnotationsFragment.
/**
* Makrs coverage of fragment of a file, e.g. of a single function.
*
* @param fileName
* @param start
* @param end
*/
public void addAnnotationsFragment(final String fileName, final int start, final int end) {
final IEditorPart currentEditor = workbench.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (currentEditor.getTitle().equals(fileName) && currentEditor instanceof ITextEditor && !currentEditor.isDirty()) {
final ModuleStats module = ModuleSet.get(fileName.replace(".erl", ""));
if (module == null || !module.couldBeMarked) {
return;
}
final List<LineResult> list = module.getLineResults();
final ITextEditor editor = (ITextEditor) currentEditor;
log.info(fileName);
for (final LineResult lr : list) {
if (lr.getLineNum() < start || end != -1 && lr.getLineNum() > end) {
continue;
}
if (!coverage.containsAnnotation(fileName, lr)) {
coverage.addAnnotation(fileName, lr, null);
}
markLine(editor, lr);
}
}
}
Aggregations