fix problems view id usage for RIDER-59000
authorMark Tkachenko <mark.tkachenko@jetbrains.com>
Tue, 2 Mar 2021 14:37:21 +0000 (17:37 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Tue, 2 Mar 2021 16:39:58 +0000 (16:39 +0000)
GitOrigin-RevId: bebaa689f144336674e0494087032bd6ff4beb55

platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java
platform/lang-impl/src/com/intellij/codeInspection/ui/actions/InspectionViewActionBase.java

index a03925301dbecc2442b6afef16720178256d9ff5..71d98c4b6fbff97442a75808f3da262f3d6c2245 100644 (file)
@@ -285,7 +285,12 @@ public class InspectionResultsView extends JPanel implements Disposable, DataPro
   boolean isAutoScrollMode() {
     String activeToolWindowId = ToolWindowManager.getInstance(getProject()).getActiveToolWindowId();
     return myGlobalInspectionContext.getUIOptions().AUTOSCROLL_TO_SOURCE &&
-           (activeToolWindowId == null || activeToolWindowId.equals(ProblemsView.ID));
+           (activeToolWindowId == null
+            || activeToolWindowId.equals(ProblemsView.ID)
+            // TODO: compatibility mode for Rider where there's no problems view; remove in 2021.2
+            // see RIDER-59000
+            //noinspection deprecation
+            || activeToolWindowId.equals(ToolWindowId.INSPECTION));
   }
 
   public void setApplyingFix(boolean applyingFix) {
index 762cf6563abbf9625a5c5d7f32bd371bd24acd0f..61bdd6a815ca0e4f438c4ab5bd45ac478f6037b1 100644 (file)
@@ -51,7 +51,13 @@ public abstract class InspectionViewActionBase extends AnAction {
       if (project == null) return null;
       ToolWindowManager twManager = ToolWindowManager.getInstance(project);
       ToolWindow window = twManager.getToolWindow(ProblemsView.ID);
-      if (window == null) return null;
+      if (window == null) {
+        // TODO: compatibility mode for Rider where there's no problems view; remove in 2021.2
+        // see RIDER-59000
+        //noinspection deprecation
+        window = twManager.getToolWindow(ToolWindowId.INSPECTION);
+        return null;
+      }
       Content selectedContent = window.getContentManager().getSelectedContent();
       if (selectedContent == null) return null;
       DataContext twContext = DataManager.getInstance().getDataContext(selectedContent.getComponent());