Search code examples
gradleintellij-idea

How get IDEA Gradle task "run configuration" from editor working if using the `tasks.register()` syntax?


IDEA has an inspection to automatically transform task XXX() to tasks.register().

enter image description here

But if this syntax is used, you can no longer run commands from the .gradle source file: there's no gutter icon and nor will the "Run/Run context configuration" keyboard shortcut work. Note that I can still run tasks from the Gradle tool view - just not from the editor.

enter image description here

enter image description here

Is there any config item or plugin or something I need to tweak to make this work again?

Version: IntelliJ IDEA 2023.2.2 (Ultimate Edition)


Solution

  • There is an existing YouTrack Issue for this:

    https://youtrack.jetbrains.com/issue/IDEA-315327/Gradle-Task-Gutter-Icons-do-not-exist-for-registered-tasks-ie-tasks.registertaskName

    which you can upvote and comment on to raise its' priority for the developers.