Only show qsync Build Deps button for project files in a main editor
Prevents the button from appearing:
in tool windows (Logcat, Run Window)
editors in dialogs (such as Find Usages)
edit project view window in the project import wizard.
@@ -26,6 +26,7 @@ import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.actionSystem.ex.CustomComponentAction;
import com.intellij.openapi.actionSystem.impl.ActionButtonWithText;
import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.EditorKind;
import com.intellij.openapi.editor.markup.InspectionWidgetActionProvider;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiDocumentManager;
@@ -51,6 +52,9 @@ public class BuildDependenciesActionProvider implements InspectionWidgetActionPr
if (!QuerySyncManager.useQuerySync.getValue()) {
return null;
}
+ if (!editor.getEditorKind().equals(EditorKind.MAIN_EDITOR)) {
+ return null;
+ }
return new BuildDependencies(editor);
}
