spek
spek copied to clipboard
IDEA Plugin: Support `Structure View`
Tests are written using nested lambdas, and for most case, our tests are nested in many many levels, and get really really long,
but Plugin doesn't parse these nested levels and display the whole nested structure in IDEA Structure View
so in Structure View
, we can only see the Test Class itself, but no Test Cases structure information at all.
It could be very difficult to navigate in test code when it is very long but not Structure View
available
especially, we could put some test code in a wrong nest level by accident
Tentatively scheduled for 2.0.9
Did a bit of looking, the structure view is linked to a particular language (on Spek's case it's Kotlin). I did find LanguageSubstitutor
which might be the solution to this, but I need to do some experiments.
StructuredView
is too tied to the language of a file making it hard to extend. Moving forward, I'll just a new tool window that shows the structure of a spek file. https://www.jetbrains.org/intellij/sdk/docs/user_interface_components/tool_windows.html