grahamsmith / dart-test

7 stars 7 forks source link

Doesn't work for top-level functions #2

Closed passsy closed 1 year ago

passsy commented 3 years ago

The plugin only works for classes. But it shows the "Create Dart Test File" Action in the whole dart file. When a dart file is empty or doesn't contain a class but only extensions or top-level functions the test file isn't generated.

https://github.com/grahamsmith/dart-test/blob/cc3c5b03ca500a32408aa384c52b04bef23181c3/src/main/kotlin/com/github/grahamsmith/darttest/actions/CreateDartTestFromIntentionAction.kt#L96

grahamsmith commented 3 years ago

Questions:

passsy commented 3 years ago

Yes, it should work for top-level functions. The filename should be the same the source file name with _test at the end. Template should be the same.

grahamsmith commented 1 year ago

This is resolved in https://github.com/grahamsmith/dart-test/pull/11