Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/392.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在IntelliJ中将通配符导入自动重构为显式导入(对于Scala/Java)_Java_Scala_Intellij Idea - Fatal编程技术网

在IntelliJ中将通配符导入自动重构为显式导入(对于Scala/Java)

在IntelliJ中将通配符导入自动重构为显式导入(对于Scala/Java),java,scala,intellij-idea,Java,Scala,Intellij Idea,考虑下面的代码 是否有可能使InteliJ自动将每个通配符导入重构为显式导入(范围中使用的内容) 例如,import scalatags.JsDom.all.\uu到import scalatags.JsDom.all.{ol,li,div} 我的研究表明这是不可能的,但也许我错了 这是一个相关但不同的问题 package app.client import app.client.components.RootReactComp import app.client.pages.spatutor

考虑下面的代码

是否有可能使InteliJ自动将每个通配符导入重构为显式导入(范围中使用的内容)

例如,
import scalatags.JsDom.all.\uu
import scalatags.JsDom.all.{ol,li,div}

我的研究表明这是不可能的,但也许我错了

这是一个相关但不同的问题

package app.client

import app.client.components.RootReactComp
import app.client.pages.spatutorial.components.GlobalStyles
import japgolly.scalajs.react.ReactDOM
import org.scalajs.dom
import org.scalajs.dom.raw.Element

import scala.scalajs.js
import scala.scalajs.js.annotation.JSExport
import scalacss.Defaults._
import scalatags.JsDom.all._
import scalatags.JsDom.implicits._
import scalatags.JsDom.svgAttrs.{fill, height, points, stroke, width,strokeWidth}
import scalatags.JsDom.svgTags._
@JSExport("Main")
  object Main extends js.JSApp {
@JSExport
         def main(): Unit = {
    //    log.warn("Application starting")
    //    // send log messages also to the server
    //    log.enableServerLogging("/logging")
    //    log.info("This message goes to server as well")

    // create stylesheet
    GlobalStyles.addToDocument()
    // tell React to render the router in the document body
    //ReactDOM.render(router(), dom.document.getElementById("root"))
    ReactDOM.render(RootReactComp.themedView(), dom.document.getElementById("joco"))
    val el: Element =dom.document.getElementById("svg-example")
     val l=     div( ol(
       li("Ordered List Item 1"),
       li("Ordered List Item 2"),
       li("Ordered List Item 3")
     )).render
  val s=    svg(height := "800", width := "500")(
                polyline(
                    points := "20,20 40,25 60,40 80,120 120,140 200,180",
                    fill := "none",
                    stroke := "black",
                    strokeWidth := "3"
                  )
           )
    el.appendChild(l);
  }
打开对话框

首选项>编辑器>代码样式>Scala
选择选项卡
Imports

在“使用导入时的类计数”字段中,输入一个高得离谱的数字,例如5000

从现在起,“优化导入”命令将把通配符解析为单个导入

您可能还想激活

编辑器>常规>自动导入>Scala>动态优化导入

谢谢这是我第一次尝试,但没有成功。对你有用吗?我在Mac上,也许有一些不同。版本2016.3.4,结果:设置:@jhegedus-起初它对我不起作用-直到我意识到在某个时候重新安装intelliJ已将“使用导入的类计数*”设置重置为默认值5。将其更改为“9999”,然后使ctrl-alt-O正常工作。