From a9acc346e5ca840fecca94761eef5984ecd5429a Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Fri, 6 Sep 2013 13:47:15 +0400 Subject: [PATCH] Removed obsolete action disabling error highlighting. --- idea/src/META-INF/plugin.xml | 5 --- .../actions/ToggleErrorReportingAction.java | 35 ------------------- .../highlighter/DebugInfoAnnotator.java | 2 +- .../jet/plugin/highlighter/JetPsiChecker.java | 11 +----- 4 files changed, 2 insertions(+), 51 deletions(-) delete mode 100644 idea/src/org/jetbrains/jet/plugin/actions/ToggleErrorReportingAction.java diff --git a/idea/src/META-INF/plugin.xml b/idea/src/META-INF/plugin.xml index 4e29a067b8f..625735db99e 100644 --- a/idea/src/META-INF/plugin.xml +++ b/idea/src/META-INF/plugin.xml @@ -64,11 +64,6 @@ - - - - diff --git a/idea/src/org/jetbrains/jet/plugin/actions/ToggleErrorReportingAction.java b/idea/src/org/jetbrains/jet/plugin/actions/ToggleErrorReportingAction.java deleted file mode 100644 index 9cb69a16a67..00000000000 --- a/idea/src/org/jetbrains/jet/plugin/actions/ToggleErrorReportingAction.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.plugin.actions; - -import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer; -import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.ToggleAction; -import org.jetbrains.jet.plugin.highlighter.JetPsiChecker; - -public class ToggleErrorReportingAction extends ToggleAction { - @Override - public boolean isSelected(AnActionEvent e) { - return JetPsiChecker.isErrorReportingEnabled(); - } - - @Override - public void setSelected(AnActionEvent e, boolean state) { - JetPsiChecker.setErrorReportingEnabled(state); - DaemonCodeAnalyzer.getInstance(e.getProject()).restart(); - } -} diff --git a/idea/src/org/jetbrains/jet/plugin/highlighter/DebugInfoAnnotator.java b/idea/src/org/jetbrains/jet/plugin/highlighter/DebugInfoAnnotator.java index 5ae9ccf49a1..e5d353901dd 100644 --- a/idea/src/org/jetbrains/jet/plugin/highlighter/DebugInfoAnnotator.java +++ b/idea/src/org/jetbrains/jet/plugin/highlighter/DebugInfoAnnotator.java @@ -40,7 +40,7 @@ public class DebugInfoAnnotator implements Annotator { @Override public void annotate(@NotNull PsiElement element, @NotNull final AnnotationHolder holder) { - if (!isDebugInfoEnabled() || !JetPsiChecker.isErrorReportingEnabled() || + if (!isDebugInfoEnabled() || !JetPluginUtil.isInSourceContent(element) || JetPluginUtil.isKtFileInGradleProjectInWrongFolder(element)) { return; diff --git a/idea/src/org/jetbrains/jet/plugin/highlighter/JetPsiChecker.java b/idea/src/org/jetbrains/jet/plugin/highlighter/JetPsiChecker.java index 1eb12eee227..a814c70b471 100644 --- a/idea/src/org/jetbrains/jet/plugin/highlighter/JetPsiChecker.java +++ b/idea/src/org/jetbrains/jet/plugin/highlighter/JetPsiChecker.java @@ -51,19 +51,10 @@ import java.util.List; import java.util.Set; public class JetPsiChecker implements Annotator { - private static volatile boolean errorReportingEnabled = true; private static boolean namesHighlightingTest; private static final Logger LOG = Logger.getInstance(JetPsiChecker.class); - public static void setErrorReportingEnabled(boolean value) { - errorReportingEnabled = value; - } - - public static boolean isErrorReportingEnabled() { - return errorReportingEnabled; - } - @TestOnly public static void setNamesHighlightingTest(boolean namesHighlightingTest) { JetPsiChecker.namesHighlightingTest = namesHighlightingTest; @@ -115,7 +106,7 @@ public class JetPsiChecker implements Annotator { try { BindingContext bindingContext = AnalyzerFacadeWithCache.analyzeFileWithCache(file).getBindingContext(); - if (errorReportingEnabled && JetPluginUtil.isInSourceContent(element, false)) { + if (JetPluginUtil.isInSourceContent(element, false)) { Collection diagnostics = Sets.newLinkedHashSet(bindingContext.getDiagnostics()); Set redeclarations = Sets.newHashSet(); for (Diagnostic diagnostic : diagnostics) {