bafolts / tplant

Typescript to plantuml
https://segmentationfaults.com/tplant/default.html
GNU General Public License v3.0
266 stars 34 forks source link

Put class accessors together with methods #117

Open lgberro opened 10 months ago

lgberro commented 10 months ago

Wouldn't it be better to have class accessors together with it's methods? That would make diagram easier to read.

class Accessors {
  _foo: string
  _bar: string

  get bar() {
    return this._bar
  }

  set bar(value) {
    this._bar = value
  }

  foo() {
    this._foo = 'foo'
  }
}

current output

Screenshot 2023-10-01 at 14 33 50
@startuml
class Accessors {
    +_foo: string
    +_bar: string
    +bar: string
    +bar: string
    +foo(): void
}
@enduml

suggestion

Screenshot 2023-10-01 at 14 32 12
@startuml
class Accessors {
    +_foo: string
    +_bar: string
    +{method} get bar: string
    +{method} set bar: string
    +foo(): void
}
@enduml