use of com.facebook.buck.intellij.ideabuck.ui.tree.BuckTreeNodeTarget in project buck by facebook.
the class BuckEventsConsumer method buildTargetErrorNode.
private BuckTreeNodeTarget buildTargetErrorNode(String target, List<String> errorMessages) {
BuckTreeNodeTarget targetNode = new BuckTreeNodeTarget(mCurrentBuildRootElement, target);
for (String currentError : errorMessages) {
ErrorExtractor errorExtractor = new ErrorExtractor(currentError);
ImmutableList<CompilerErrorItem> errorItems = errorExtractor.getErrors();
BuckTreeNodeFileError currentFileErrorNode = null;
String currentFilePath = "";
for (CompilerErrorItem currentErrorItem : errorItems) {
if (!currentErrorItem.getFilePath().equals(currentFilePath)) {
if (currentFileErrorNode != null) {
// Add to parent
targetNode.addFileError(currentFileErrorNode);
}
// Create the new node, for the new file
currentFileErrorNode = new BuckTreeNodeFileError(targetNode, currentErrorItem.getFilePath(), currentErrorItem);
currentFilePath = currentErrorItem.getFilePath();
} else {
currentFileErrorNode.addError(currentErrorItem);
}
}
if (currentFileErrorNode != null) {
// Add the leftovers
targetNode.addFileError(currentFileErrorNode);
}
}
return targetNode;
}
use of com.facebook.buck.intellij.ideabuck.ui.tree.BuckTreeNodeTarget in project buck by facebook.
the class BuckEventsConsumer method displayErrors.
private void displayErrors() {
if (mErrors.size() > 0) {
if (!BuckToolWindowFactory.isToolWindowVisible(mProject)) {
BuckToolWindowFactory.showToolWindow(mProject);
}
Set<String> targetsWithErrors = mErrors.keySet();
for (String target : targetsWithErrors) {
List<String> errorMessages = mErrors.get(target);
if (errorMessages.size() > 0) {
BuckTreeNodeTarget targetNode = buildTargetErrorNode(target, errorMessages);
mCurrentBuildRootElement.addChild(targetNode);
}
}
}
}
Aggregations