kotest / kotest-intellij-plugin

The official Kotest plugin for Intellij and Android Studio
Apache License 2.0
175 stars 23 forks source link

`Run '{TestObjectName}` will not work unless cursor is at start of line of class definition #236

Closed scarf005 closed 1 year ago

scarf005 commented 1 year ago

To reproduce

_05

  1. find the test shortcut to run test (in this case Ctrl + Shift + F10)

_03

  1. pressing test shortcut will not work. pressing test shortcut inside test body will not work, either.

_04

  1. pressing test shortcut will work.

it's frustrating because of constant cursor moving.

sesamzoo commented 1 year ago

In case of a class SomeTest the test shortcut will work only when the text cursor is in the range "before the 'c' of class" and "before the second 's' of class".

Kantis commented 1 year ago

IntelliJs RunLineMarkerContributor only allows us to contribute this info for a single PSI element, and the action is attached to that element. There's no such element that encompasses both the keyword and identifier (and supertype), so we have to settle for either having it on class/object or the name itself.