Plugin works correctly in IntelliJ debug environment but not production

Answered

I have been enhancing the Dart plugin to support developing dart code in WSL.

While doing this I have a problem where the Dart plugin will work when debugging in the intellij-community build environment but not when packaged as a jar file and installed in the production environment.

The plugin loads and appears to work but there are a couple of functions that don't work as expected.

An example of this is the inability to launch a command line debugger of the dart code from within the production environment.

When this is launched the process simply hangs waiting for the debugger to connect.

In the intellij-community build environment the debugger connects normally and stops at the first breakpoint.

The plugin that is installed from the plugins repository works in production.

The process I follow to package my build of the plugin is to simply zip the files that are in the output directory and change the extension to jar, I could not find a way to do this in the build process described on the plugin page.

To try and further diagnose I inserted notifications into the code as follows

    Notifications.Bus.notify(new Notification("notification.group.dart.support", "In VmService connect " + url, NotificationType.INFORMATION));

In the debug build all messages showed

When run in production it did not pass calling a static call VmService.connect(url).

  private void connect(@NotNull String url) throws IOException {
    Notifications.Bus.notify(new Notification("notification.group.dart.support", "Starting Connection to Debugger " + url, NotificationType.INFORMATION));
    Notifications.Bus.notify(new Notification("notification.group.dart.support", "Starting Connection to Debugger2 " + url, NotificationType.INFORMATION));
    final VmService vmService = VmService.connect(url);
    Notifications.Bus.notify(new Notification("notification.group.dart.support", "Should be connected to Debugger " + url, NotificationType.INFORMATION));

The Intellij log does not show any messages related to this.

I also tried building the same things with a unmodified checkout of the code with at tag idea/241.18034.62 and it produced the same results.

This leads me to believe I don't have the build settings correct but I have tried a few different versions of version 17 jdk's with no difference made.

Any advice that can be offered would be appreciated.

I am running the Intellij Ultimate as follows

IntelliJ IDEA 2024.1.4 (Ultimate Edition)
Build #IU-241.18034.62, built on June 21, 2024
Runtime version: 17.0.11+1-b1207.24 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11.0
Kotlin analyzer version: 2.0.0-ij241.15989-9
GC: G1 Young Generation, G1 Old Generation
Memory: 8192M
Cores: 16
Registry:
 markdown.open.vcs.log.link=true
 llm.generate.commit.summary=true
Non-Bundled Plugins:
 com.github.leomillon.uuidgenerator (4.5.1)
 org.antlr.intellij.plugin (1.23.1)
 Batch Scripts Support (1.0.13)
 dev.meanmail.plugin.nginx-intellij-plugin (2024.3)
 Pythonid (241.17890.1)
 org.jetbrains.idea.grammar (2022.3.2)
 DevKit (241.18034.106)
 VisualVMLauncher (1.23.1-IJ2023.3)
 String Manipulation (9.14.1)
 com.intellij.ml.llm (241.18034.12)
 Dart (241.18034.62)
 org.exbin.deltahex.intellij (0.2.10.1)
 org.jetbrains.android (241.17011.79)
Kotlin: 241.18034.62-IJ

0
2 comments

Unfortunately, the Dart plugin is currently not setup for “autonomous” build via Gradle, so your strategy is the best currently available.

Please double check that the final plugin distribution ZIP file contains all necessary additional library jar files under /lib/

0

FWIW, I wanted to mention that it's possible to debug the production IDE, which is more convenient than adding fake notifications). In the “development” IDE (the one with the plugin sources) create a special “Remote JVM Debug” run configuration. Then tune the production IDE VM options as suggested (Help → Edit Custom VM Options…)

0

Please sign in to leave a comment.