Skip to content

Commit 10ff3d2

Browse files
committed
Refactor action event creation in settings component
Simplified `AnActionEvent` creation by compacting imports and modifying parameters to match updated API structure. These changes improve code clarity and maintain compatibility with the latest IntelliJ Platform APIs.
1 parent 9c3adbe commit 10ff3d2

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

.idea/modules/prettify-python.main.iml

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules/prettify-python.test.iml

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/kotlin/dev/meanmail/prettifypython/settings/PrettifySettingsComponent.kt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ package dev.meanmail.prettifypython.settings
22

33
import com.intellij.icons.AllIcons
44
import com.intellij.ide.plugins.PluginManagerCore
5-
import com.intellij.openapi.actionSystem.ActionManager
6-
import com.intellij.openapi.actionSystem.ActionToolbarPosition
7-
import com.intellij.openapi.actionSystem.AnAction
8-
import com.intellij.openapi.actionSystem.AnActionEvent
5+
import com.intellij.openapi.actionSystem.*
96
import com.intellij.openapi.actionSystem.impl.SimpleDataContext
107
import com.intellij.openapi.application.ApplicationInfo
118
import com.intellij.openapi.extensions.PluginId
@@ -327,12 +324,13 @@ class PrettifySettingsComponent {
327324
val presentation = action.templatePresentation.clone()
328325
action.update(
329326
AnActionEvent(
330-
null,
331327
SimpleDataContext.EMPTY_CONTEXT,
332-
"PrettifySettingsComponent",
333328
presentation,
334-
ActionManager.getInstance(),
335-
0
329+
"PrettifySettingsComponent",
330+
ActionUiKind.NONE,
331+
null,
332+
0,
333+
ActionManager.getInstance()
336334
)
337335
)
338336
}

0 commit comments

Comments
 (0)