use of com.jetbrains.lang.dart.ide.errorTreeView.DartProblemsView in project intellij-plugins by JetBrains.
the class DartExecutionHelper method displayIssues.
public static void displayIssues(@NotNull final Project project, @NotNull VirtualFile launchFile, @NotNull String launchTitle, @Nullable Icon icon) {
clearIssueNotifications(project);
List<DartServerData.DartError> errors = getIssues(project, launchFile);
if (errors.isEmpty()) {
return;
}
final DartProblemsView problemsView = DartProblemsView.getInstance(project);
final String content;
if (errors.size() == 1) {
content = errors.get(0).getMessage();
} else {
content = errors.size() + " " + StringUtil.pluralize("issue", errors.size()) + " found.";
}
// Show a notification on the dart analysis tool window.
problemsView.showErrorNotification(launchTitle, content, icon);
// Jump to and highlight the first error (order unspecified) in the editor.
/*
DartServerData.DartError error = errors.get(0);
final VirtualFile errorFile = LocalFileSystem.getInstance().findFileByPath(error.getAnalysisErrorFileSD());
if (errorFile != null) {
final OpenFileDescriptor descriptor = new OpenFileDescriptor(project, errorFile, error.getOffset());
descriptor.setScrollType(ScrollType.MAKE_VISIBLE);
descriptor.navigate(true);
}
*/
}
use of com.jetbrains.lang.dart.ide.errorTreeView.DartProblemsView in project intellij-plugins by JetBrains.
the class DartExecutionHelper method clearIssueNotifications.
public static void clearIssueNotifications(@NotNull final Project project) {
final DartProblemsView problemsView = DartProblemsView.getInstance(project);
problemsView.clearNotifications();
}
Aggregations