suusan2go / kotlin-fill-class

Intellij plugin that provides intention action for empty constructor

Home Page:https://plugins.jetbrains.com/plugin/10942-kotlin-fill-class

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: Add option to use trailing comma

xsveda opened this issue · comments

Kotlin 1.4 supports trailing commas. They can be enabled in Idea's Settings->Editor->Code Style->Kotlin->Other.

It would be great if the plugin would respect the setting and generate trailing comma, so instead:

User(
  name = "",
  phone = "",
  address = ""
)

it would generate

User(
  name = "",
  phone = "",
  address = "",
)

You can add trailing comma without option.

  1. Enable User trailing comma

スクリーンショット 2021-02-11 7 48 41

  1. Enable kotlin.formatter.allowTrailingCommaOnCallSite

スクリーンショット 2021-02-11 7 41 16

スクリーンショット 2021-02-11 7 41 58

  1. Fill class constructor

スクリーンショット 2021-02-11 7 42 57

スクリーンショット 2021-02-11 7 43 04

  1. Put arguments on separate lines

スクリーンショット 2021-02-11 7 43 16

スクリーンショット 2021-02-11 7 43 26

Thank you @t-kameyama, works great!