scala-ide / scala-refactoring

A library providing automated refactoring support for Scala.
http://scala-refactoring.org/
Other
69 stars 47 forks source link

Compilation error after "Organize Imports" if importing contents of an object within a method. #146

Open mdelem opened 8 years ago

mdelem commented 8 years ago

Using Scala Refactoring 0.9.1.2_11-201603041823 (Scala IDE 4.4.0-RC1):

object AnObject {
  val a = 3
}

object Test {
  def test() : Int = {
    import AnObject._

    a
  }

}

is refactored after "Organize Imports" to:

object AnObject {
  val a = 3
}

object Test {
  def test() : Int = {

    a
  }

}

Which makes the 'a' statement invalid.

wpopielarski commented 8 years ago

I think there is a ticket open against it. But if you are impatient and open for exciting adventures and ready to help doing scala refactoring better so you could get this guy to play with a little https://github.com/scala-ide/scala-refactoring/pull/144

Thanks in advance :)

2016-03-13 22:33 GMT+01:00 Martin Delemotte notifications@github.com:

Using Scala Refactoring 0.9.1.2_11-201603041823 (Scala IDE 4.4.0-RC1):

object AnObject { val a = 3 } object Test { def test() : Int = { import AnObject._

a

}

}

is refactored after "Organize Imports" to:

object AnObject { val a = 3 } object Test { def test() : Int = {

a

}

}

Which makes the 'a' statement invalid.

— Reply to this email directly or view it on GitHub https://github.com/scala-ide/scala-refactoring/issues/146.