Debugging the Bazel IntelliJ plugin

205 views
Skip to first unread message

Dan Fabulich

unread,
Dec 29, 2016, 12:54:21 AM12/29/16
to bazel-discuss
I'd like to contribute fixes to the Bazel IntelliJ plugin; I've never worked on an IntelliJ plugin before. In preparation, I went through JetBrains' "Creating Your First Plugin" guide http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started.html and built and ran a simple "hello world" action.

I then went to https://github.com/bazelbuild/intellij and built that from scratch using Bazel. I also used the Bazel IntelliJ plugin itself to load the plugin itself.

But when I load ijwb/ijwb.bazelproject using the Bazel plugin, IntelliJ doesn't seem to recognize it as a "Plugin Project," despite the fact that the workspace_type is "intellij_plugin."

I don't see any way to Run the plugin as I did following the JetBrains tutorial http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/running_and_debugging_a_plugin.html and I especially don't see how to attach a debugger to the plugin.

Is it possible to attach a debugger to the ijwb plugin? If not, how do developers debug the UI code? (Log files? Dropped where?)

-Dan

Damien Martin-guillerez

unread,
Dec 29, 2016, 4:13:59 AM12/29/16
to Dan Fabulich, bazel-discuss, to...@google.com, brendan...@google.com
+Tom Lundell +Brendan Douglas might help (if they are around)

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/67bcf5c8-1013-41a6-857e-a95b7014eab9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brendan Douglas

unread,
Dec 29, 2016, 9:00:22 AM12/29/16
to Dan Fabulich, bazel-discuss, to...@google.com, Damien Martin-guillerez
Hi Dan,

We debug using a custom run configuration type ('Bazel IntelliJ Plugin', source code in BlazeIntellijPluginConfiguration), which will spawn an IntelliJ instance with the selected plugin installed.

When you load the project specified by 'ijwb/ijwb.bazelproject', a run configuration called 'Bazel build ijwb:ijwb_bazel' should appear after the first bazel sync. You can debug the plugin using this run configuration.

Cheers,
Brendan

On Thu, Dec 29, 2016 at 4:13 AM, Damien Martin-guillerez <dmar...@google.com> wrote:
+Tom Lundell +Brendan Douglas might help (if they are around)

On Thu, Dec 29, 2016 at 6:54 AM Dan Fabulich <danfa...@gmail.com> wrote:
I'd like to contribute fixes to the Bazel IntelliJ plugin; I've never worked on an IntelliJ plugin before. In preparation, I went through JetBrains' "Creating Your First Plugin" guide http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started.html and built and ran a simple "hello world" action.

I then went to https://github.com/bazelbuild/intellij and built that from scratch using Bazel. I also used the Bazel IntelliJ plugin itself to load the plugin itself.

But when I load ijwb/ijwb.bazelproject using the Bazel plugin, IntelliJ doesn't seem to recognize it as a "Plugin Project," despite the fact that the workspace_type is "intellij_plugin."

I don't see any way to Run the plugin as I did following the JetBrains tutorial http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/running_and_debugging_a_plugin.html and I especially don't see how to attach a debugger to the plugin.

Is it possible to attach a debugger to the ijwb plugin? If not, how do developers debug the UI code? (Log files? Dropped where?)

-Dan

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.

Aryeh Hillman

unread,
Jun 25, 2022, 5:18:36 PMJun 25
to bazel-discuss
Do any folks currently do this and could they offer a screenshot of their run/debug config?

On Thursday, December 29, 2016 at 6:00:22 AM UTC-8 Brendan Douglas wrote:
Hi Dan,

We debug using a custom run configuration type ('Bazel IntelliJ Plugin', source code in BlazeIntellijPluginConfiguration), which will spawn an IntelliJ instance with the selected plugin installed.

When you load the project specified by 'ijwb/ijwb.bazelproject', a run configuration called 'Bazel build ijwb:ijwb_bazel' should appear after the first bazel sync. You can debug the plugin using this run configuration.

Cheers,
Brendan

On Thu, Dec 29, 2016 at 4:13 AM, Damien Martin-guillerez <dmar...@google.com> wrote:
+Tom Lundell +Brendan Douglas might help (if they are around)

On Thu, Dec 29, 2016 at 6:54 AM Dan Fabulich <danfa...@gmail.com> wrote:
I'd like to contribute fixes to the Bazel IntelliJ plugin; I've never worked on an IntelliJ plugin before. In preparation, I went through JetBrains' "Creating Your First Plugin" guide http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started.html and built and ran a simple "hello world" action.

I then went to https://github.com/bazelbuild/intellij and built that from scratch using Bazel. I also used the Bazel IntelliJ plugin itself to load the plugin itself.

But when I load ijwb/ijwb.bazelproject using the Bazel plugin, IntelliJ doesn't seem to recognize it as a "Plugin Project," despite the fact that the workspace_type is "intellij_plugin."

I don't see any way to Run the plugin as I did following the JetBrains tutorial http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/running_and_debugging_a_plugin.html and I especially don't see how to attach a debugger to the plugin.

Is it possible to attach a debugger to the ijwb plugin? If not, how do developers debug the UI code? (Log files? Dropped where?)

-Dan

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.

Edbert Chan

unread,
Jul 25, 2022, 1:39:44 PMJul 25
to bazel-discuss
Don't know if this is thread necromancy but you can just debug Android Studio/IJ itself via vmoptions (add the agentlib:jdwp=transport jvm argument that IJ gives you when you create a remote configuration). Open the plugin code in a second IJ instance and put a breakpoint in the plugin code.
Reply all
Reply to author
Forward
0 new messages