rsc icon indicating copy to clipboard operation
rsc copied to clipboard

Automatically insert renamed import statements for long type ascriptions

Open wiwa opened this issue 6 years ago • 0 comments

Consider CountDownLatch in examples/core:

package com.twitter.util

import java.util.concurrent.TimeUnit

class CountDownLatch(val initialCount: Int) {
  val underlying: java.util.concurrent.CountDownLatch = new java.util.concurrent.CountDownLatch(initialCount)
  ...
}

In this example, no shortening of underlying's type can be applied even with automatic import statements, since CountDownLatch is in scope, concurrent is in scope as scala.concurrent, and util is the package name. Thus we may want to import java.util.concurrent.CountDownLatch as a renamed import, something like java.util.concurrent.{CountDownLatch => JavaCountDownLatch}.

wiwa avatar Jan 15 '19 21:01 wiwa