From 0dfdda55c00c46a307e52659debdb46f7e565823 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Wed, 12 Jan 2022 17:18:46 +0300 Subject: [PATCH] remove useless com.intellij.analysis.problemsView.toolWindow.ProblemsView#isProjectErrorsEnabled GitOrigin-RevId: 7204ff44faaaa26e615f27bc5e8537a450278537 --- .../problemsView/toolWindow/HighlightingFileRoot.kt | 4 ++-- .../problemsView/toolWindow/HighlightingPanel.kt | 12 +----------- .../problemsView/toolWindow/ProblemsView.java | 10 +--------- .../ProblemsViewProjectErrorsPanelProvider.kt | 3 +-- .../toolWindow/ProjectErrorsCollector.kt | 3 +-- 5 files changed, 6 insertions(+), 26 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/HighlightingFileRoot.kt b/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/HighlightingFileRoot.kt index 80f2fd60eb01..64879f87adb3 100644 --- a/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/HighlightingFileRoot.kt +++ b/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/HighlightingFileRoot.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.analysis.problemsView.toolWindow import com.intellij.analysis.problemsView.Problem @@ -57,7 +57,7 @@ internal class HighlightingFileRoot(panel: ProblemsViewPanel, val file: VirtualF notify(problem, synchronized(problems) { SetUpdateState.add(problem, problems) }) if (Registry.`is`("wolf.the.problem.solver")) return // start filling HighlightingErrorsProvider if WolfTheProblemSolver is disabled - if (!ProblemsView.isProjectErrorsEnabled() || problem.severity < HighlightSeverity.ERROR.myVal) return + if (problem.severity < HighlightSeverity.ERROR.myVal) return HighlightingErrorsProviderBase.getInstance(problem.provider.project).problemsAppeared(file) } diff --git a/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/HighlightingPanel.kt b/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/HighlightingPanel.kt index 11e6d03e85a0..f141b0f7d7d7 100644 --- a/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/HighlightingPanel.kt +++ b/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/HighlightingPanel.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.analysis.problemsView.toolWindow import com.intellij.codeWithMe.ClientId @@ -50,16 +50,6 @@ class HighlightingPanel(project: Project, state: ProblemsViewState) return super.getData(dataId) } - override fun getToolWindowIcon(count: Int): Icon? { - if (ProblemsView.isProjectErrorsEnabled()) return null - val root = currentRoot ?: return Toolwindows.ToolWindowProblemsEmpty - val problem = root.getChildren(root.file).any { - val severity = (it as? ProblemNode)?.severity - severity != null && severity >= HighlightSeverity.ERROR.myVal - } - return if (problem) Toolwindows.ToolWindowProblems else Toolwindows.ToolWindowProblemsEmpty - } - override fun selectionChangedTo(selected: Boolean) { super.selectionChangedTo(selected) if (selected) updateCurrentFile() diff --git a/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProblemsView.java b/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProblemsView.java index 33292ac219f8..dceb477c54c4 100644 --- a/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProblemsView.java +++ b/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProblemsView.java @@ -1,9 +1,6 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.analysis.problemsView.toolWindow; -import com.intellij.openapi.actionSystem.AnAction; -import com.intellij.openapi.actionSystem.ex.ActionUtil; -import com.intellij.ide.util.PropertiesComponent; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.ex.RangeHighlighterEx; import com.intellij.openapi.project.DumbAware; @@ -104,13 +101,8 @@ public final class ProblemsView implements DumbAware, ToolWindowFactory { return type.isInstance(component) ? (T)component : null; } - static boolean isProjectErrorsEnabled() { - return true; // TODO: use this method to disable Project Errors tab in other IDEs - } - @Override public void init(@NotNull ToolWindow window) { - if (!isProjectErrorsEnabled()) return; Project project = ((ToolWindowEx)window).getProject(); HighlightingErrorsProviderBase.getInstance(project); } diff --git a/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProblemsViewProjectErrorsPanelProvider.kt b/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProblemsViewProjectErrorsPanelProvider.kt index 74d4fd34326b..e35785cc742b 100644 --- a/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProblemsViewProjectErrorsPanelProvider.kt +++ b/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProblemsViewProjectErrorsPanelProvider.kt @@ -1,3 +1,4 @@ +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.analysis.problemsView.toolWindow import com.intellij.openapi.actionSystem.ex.ActionUtil @@ -14,8 +15,6 @@ class ProblemsViewProjectErrorsPanelProvider(private val project: Project) : Pro private val ACTION_IDS = listOf("CompileDirty", "InspectCode") override fun create(): ProblemsViewTab? { - if (!ProblemsView.isProjectErrorsEnabled()) return null - val state = ProblemsViewState.getInstance(project) val panel = ProblemsViewPanel(project, ID, state, ProblemsViewBundle.messagePointer("problems.view.project")) panel.treeModel.root = CollectorBasedRoot(panel) diff --git a/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProjectErrorsCollector.kt b/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProjectErrorsCollector.kt index 6ae6ff6c354a..718233cf4742 100644 --- a/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProjectErrorsCollector.kt +++ b/platform/lang-impl/src/com/intellij/analysis/problemsView/toolWindow/ProjectErrorsCollector.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.analysis.problemsView.toolWindow import com.intellij.analysis.problemsView.FileProblem @@ -121,7 +121,6 @@ private class ProjectErrorsCollector(val project: Project) : ProblemsCollector { } private fun updateToolWindowIcon() { - if (!ProblemsView.isProjectErrorsEnabled()) return AppUIUtil.invokeLaterIfProjectAlive(project) { ProblemsView.getToolWindow(project)?.setIcon(getToolWindowIcon()) } }