From 634263ad85f2ef68422d9bed87d1e5a533dedef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Tue, 12 Mar 2024 13:55:48 +0100 Subject: [PATCH] [platform] AnAction: log causing plugin GitOrigin-RevId: 73e2006886d92d062ecb4915af8cd76ecb8f9089 --- .../intellij/openapi/actionSystem/AnAction.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/AnAction.java b/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/AnAction.java index 3539a0db7473..9645c7a359ae 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/AnAction.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/AnAction.java @@ -2,6 +2,7 @@ package com.intellij.openapi.actionSystem; import com.intellij.diagnostic.LoadingState; +import com.intellij.diagnostic.PluginException; import com.intellij.openapi.Disposable; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; @@ -375,9 +376,13 @@ public abstract class AnAction implements PossiblyDumbAware, ActionUpdateThreadA LoadingState.PROJECT_OPENED.isOccurred()) { ActionManager actionManager = ApplicationManager.getApplication().getServiceIfCreated(ActionManager.class); if (actionManager != null && actionManager.getId(this) != null) { - LOG.warn("ShortcutSet of global AnActions should not be changed outside of KeymapManager.\n" + - "This is likely not what you wanted to do. Consider setting shortcut in keymap defaults, inheriting from other action " + - "using `use-shortcut-of` or wrapping with EmptyAction.wrap().", new Throwable(this.toString())); + LOG.warn(PluginException.createByClass( + "ShortcutSet of global AnActions should not be changed outside of KeymapManager.\n" + + "This is likely not what you wanted to do. Consider setting shortcut in keymap defaults, inheriting from other action " + + "using `use-shortcut-of` or wrapping with EmptyAction.wrap(). Action: " + this, + null, + getClass()) + ); } } myShortcutSet = shortcutSet; @@ -428,7 +433,10 @@ public abstract class AnAction implements PossiblyDumbAware, ActionUpdateThreadA public void copyActionTextOverride(@NotNull String fromPlace, @NotNull String toPlace, String id) { Supplier value = myActionTextOverrides.get(fromPlace); if (value == null) { - LOG.error("Missing override-text for action " + id + " and place specified in use-text-of-place: " + fromPlace); + LOG.error(PluginException.createByClass( + "Missing override-text for action id: " + id + ", use-text-of-place: " + fromPlace, + null, + getClass())); return; } myActionTextOverrides = myActionTextOverrides.plus(toPlace, value);