remove useless com.intellij.analysis.problemsView.toolWindow.ProblemsView#isProjectErrorsEnabled

GitOrigin-RevId: 7204ff44faaaa26e615f27bc5e8537a450278537
This commit is contained in:
Sergey Malenkov
2022-01-12 23:41:00 +00:00
committed by intellij-monorepo-bot
parent 979a7aa59b
commit 0dfdda55c0
5 changed files with 6 additions and 26 deletions
@@ -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)
}
@@ -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()
@@ -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);
}
@@ -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)
@@ -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()) }
}