Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.intellij.notification.Notification;
import com.intellij.notification.NotificationType;
import com.intellij.notification.Notifications;
import com.intellij.openapi.actionSystem.ActionManager;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.DumbAwareAction;
Expand All @@ -17,6 +18,7 @@
import com.jetbrains.lang.dart.analyzer.DartAnalysisServerService;
import org.dartlang.analysis.server.protocol.RequestError;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class AnalysisServerDiagnosticsAction extends DumbAwareAction {

Expand All @@ -41,12 +43,10 @@ public void actionPerformed(@NotNull AnActionEvent e) {
final Project project = e.getProject();
if (project == null) return;

run(project);

Analytics.report(AnalyticsData.forAction(this, e));
run(project, e);
}

void run(final @NotNull Project project) {
void run(final @NotNull Project project, @Nullable AnActionEvent event) {
// Get the current analysis server.
DartAnalysisServerService server = DartAnalysisServerService.getInstance(project);

Expand All @@ -66,5 +66,14 @@ public void onError(RequestError requestError) {
Notifications.Bus.notify(notification);
}
});

if (event != null) {
Analytics.report(AnalyticsData.forAction(this, event));
} else {
ActionManager actionManager = ActionManager.getInstance();
if (actionManager != null) {
Analytics.report(AnalyticsData.forAction(actionManager.getId(this), project));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected void hyperlinkActivated(final @NotNull HyperlinkEvent e) {
myAnalysisDiagnosticsHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
protected void hyperlinkActivated(final @NotNull HyperlinkEvent e) {
new AnalysisServerDiagnosticsAction().run(myProject);
new AnalysisServerDiagnosticsAction().run(myProject, null);
}
});
}
Expand Down
Loading