Refactoring with scalajs-react
mdelem opened this issue · 2 comments
Hi,
Using Scala Refactoring 0.9.1.2_11-201603041823 (Scala IDE 4.4.0-RC1) I get an error while trying to organize imports when using scalajs-react.
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.prefix_<^._
object Footer {
val component = ReactComponentB.static("Footer",
<.footer(^.textAlign.center,
<.div(^.borderBottom := "1px solid grey", ^.padding := "0px"),
<.p(^.paddingTop := "5px", "Humans, welcome!")
)
).buildU
def apply() = component()
}Refactors to:
import japgolly.scalajs.react.ReactComponentB
import japgolly.scalajs.react.reactNodeInhabitableS
import japgolly.scalajs.react.vdom.prefix_<^.{ ^ => ^ }
import japgolly.scalajs.react.vdom.prefix_<^._react_autoRender
import japgolly.scalajs.react.vdom.prefix_<^._react_fragReactNode
import japgolly.scalajs.react.vdom.prefix_<^._react_styleString
object Footer {
val component = ReactComponentB.static("Footer",
<.footer(^.textAlign.center,
<.div(^.borderBottom := "1px solid grey", ^.padding := "0px"),
<.p(^.paddingTop := "5px", "Humans, welcome!")
)
).buildU
def apply() = component()
}Thus generating an error (value < not found) on these lines:
<.footer(^.textAlign.center,
<.div(^.borderBottom := "1px solid grey", ^.padding := "0px"),
<.p(^.paddingTop := "5px", "Humans, welcome!")Not sure this is fixable but I thought I'd let you know. Keep the good work!
Which organize imports strategy do you have selected in Window > Preferences > Scala > Editor > Organize Imports?
It was "One import statement per importee".
I switched to "Preserve only wildcards". Works fine.
I didn't know about these options. Thanks!
Martin Delemotte
On Sun, Mar 13, 2016 at 2:05 PM, Simon Schäfer notifications@github.com
wrote:
Which organize imports strategy do you have selected in Window >
Preferences > Scala > Editor > Organize Imports?—
Reply to this email directly or view it on GitHub
#145 (comment)
.