A simple experimental test coverage plugin written in C# and Blazor for JetBrains Rider.
It all started with me needing to create a plugin for IntelliJ. Knowing very little about the platform, I digged into the documentation to see how to do this. Unfortunately for me, I quickly discovered that I would need to use Java Swing for the UI, which I happen to hate with passion... So I then started looking for "something else" that would be more pleasant to use, and stumble accross JBCEF, which is the JetBrains implementation / integration of CEF into the IntelliJ platform. Great news, I can know use web technologies for the UI now such as Svelte and interop with the koltin code for the backend part. But, what if I could avoid Java entirely? I then discovered a plugin template dedicated to create plugins for Rider, that uses C#. That was great news, until I realized that I'd need to work basically twice as much to make kotlin and C# talk to each other (bridge communication) and still have to deal for the Java ecosystem since if the C# part mainly focuses on ReSharper ... I mean if I was able to ditch Java Swing, there's probably a way to avoid most Java / Kotlin code right? Right! Using a backend process!
This plugin uses as little as possible Kotlin code to work. Most of the plugin is written in C# and Blazor. It goes as follow: The kotlin part etasblish the basics for the plugin to initialize itself in the IntelliJ platform, then create a tool window containing a JBCEF control and finally boot the backend. The backend part is a Blazor server application that serves the UI in the tool window through the JBCEF control. Any interactions with the UI is then handled by Blazor. The kotlin code establish a connection using a named pipe to the C# backend. This connection is mainly used by the C# backend to invoke actions that belongs to the IntelliJ platform, such as opening a file in the project. Using a named pipe is pretty useful, because it's ideal for easy process-to-process communications in a bidirectionnal and asynchronous context, which let's both C# backend and kotlin (IntelliJ) talk to each other easily, quickly with no overhead.
The even more interesting part with this experimental template, is that you can easily replace C# and Blazor the tech stack of your choice, such Golang and HTMX, React and Node.js or Svelte and Kotlin (if you keep the backend in the kotlin part and drop the backend process entirely)