Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

differentiate Kotlin generic type parameters #1994

Open
btwilk opened this issue Sep 19, 2023 · 0 comments
Open

differentiate Kotlin generic type parameters #1994

btwilk opened this issue Sep 19, 2023 · 0 comments
Labels
enhancement-request A request for an enhancement to be developed.

Comments

@btwilk
Copy link

btwilk commented Sep 19, 2023

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 btwilk added the enhancement-request A request for an enhancement to be developed. label Sep 19, 2023
@btwilk btwilk changed the title differentiate Kotlin generic types differentiate Kotlin generic type parameters Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement-request A request for an enhancement to be developed.
Projects
None yet
Development

No branches or pull requests

1 participant