rouge icon indicating copy to clipboard operation
rouge copied to clipboard

differentiate Kotlin generic type parameters

Open btwilk opened this issue 2 years ago • 0 comments

Is your enhancement request related to a problem? Please describe. It can be hard differentiate a standard type (e.g., interface/class) and a generic type parameter.

class Container<Element> {
  ...
  // lots of stuff
  ...
  fun foo(e: Element) { // looking only here it is not clear that Element is a generic type parameter
    ...
  }
  ...
}

Describe the solution you'd like Give generic type parameters a distinct color from interfaces/classes.

Additional context

  • IntelliJ does this by default.
  • Java/Kotlin programmers conventionally use single-letter parameter names for generics. This is evidence that it is important to distingush them from interfaces/classes.
  • If syntax highlighting can help with this differentiation, then there is less motivation to purposely use bad parameter names like E.

btwilk avatar Sep 19 '23 23:09 btwilk