Custom run/debug from margin plugin

Answered

Hello,

I have developed a custom kotlin DSL that declares integration tests for a particularly complex system, and I'd like to assist developers in writing tests by making it possible to run an individual test from the margin, just like when there is a `fun main() {...}` present in the file. Because of various structural reasons I can't just have a main function for every test so would like to have it where the DSL block is present (I can probably find this block easily enough with reflection).

Is there any useful reference guide on where to start with this? I'm using kotest so I'm intending to dissect https://github.com/kotest/kotest-intellij-plugin which can play specs from the margins, so must have the bits I need, but if there is an easier way or better reference material, I'd much appreciate it!

 

Thanks, Zak

2 comments
Comment actions Permalink

Such run line markers are usually contributed via com.intellij.runLineMarkerContributor extension point, you can find all usages from OSS Plugins in this list:  https://plugins.jetbrains.com/intellij-platform-explorer?extensions=com.intellij.runLineMarkerContributor

 

Reference: https://plugins.jetbrains.com/docs/intellij/basic-run-configurations.html

 

1
Comment actions Permalink

Thanks Yann, that's a really useful resource. I'll have a dig through a few and see if I can find something similar to what I'm trying to achieve

0

Please sign in to leave a comment.