Skip to content

Add .mill extension to Scala language support #666

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

Closed
wants to merge 10 commits into from

Conversation

lihaoyi
Copy link
Contributor

@lihaoyi lihaoyi commented Sep 4, 2024

The Mill Scala build tool recently moved its file format extension from .sc to .mill (com-lihaoyi/mill#3426) to better differentiate it from other Scala scripts (Ammonite, Scala-CLI, IntelliJ/VSCode worksheets). This updates intellij to understand that .mill files should be highlighted as Scala

@lihaoyi
Copy link
Contributor Author

lihaoyi commented Sep 4, 2024

I'm having trouble testing this on my laptop, with the readme's packaging instructions giving me the following error

lihaoyi intellij-scala$ sbt packageArtifactZip
[info] welcome to sbt 1.10.1 (Homebrew Java 22.0.2)
[info] loading settings for project intellij-scala-build from plugins.sbt ...
[info] loading project definition from /Users/lihaoyi/Github/intellij-scala/project
[info] loading settings for project scalaCommunity from build.sbt ...
[info] resolving key references (52671 settings) ...
[info] set current project to scalaCommunity (in build file:/Users/lihaoyi/Github/intellij-scala/)
[warn] there are 4 keys that are not used by any other settings/tasks:
[warn]
[warn] * runtimeDependencies / ideSkipProject
[warn]   +- /Users/lihaoyi/Github/intellij-scala/build.sbt:822
[warn] * scala-api / idePackagePrefix
[warn]   +- /Users/lihaoyi/Github/intellij-scala/build.sbt:106
[warn] * scala-impl / ideExcludedDirectories
[warn]   +- /Users/lihaoyi/Github/intellij-scala/build.sbt:367
[warn] * tasty-reader / idePackagePrefix
[warn]   +- /Users/lihaoyi/Github/intellij-scala/build.sbt:317
[warn]
[warn] note: a setting might still be used by a command; to exclude a key from this `lintUnused` check
[warn] either append it to `Global / excludeLintKeys` or call .withRank(KeyRanks.Invisible) on the key
[info] + IdeaDependency(BuildInfo(ideaIC-242.21829.40)) is up to date: 2/2
[warn] Failed to check locally installed JBR version(assuming true): /Users/lihaoyi/.ScalaPluginIC/sdk/242.21829.40/jbr/release
[info] + JbrDependency(AutoJbr(None,None,None)) is up to date: 1/1
[info] + PluginDependency(com.intellij.java) is up to date: 3/3
[info] + PluginDependency(JUnit) is up to date: 5/5
[info] + PluginDependency(com.intellij.gradle) is up to date: 2/2
[info] + PluginDependency(org.jetbrains.idea.maven) is up to date: 15/15
[info] + PluginDependency(org.jetbrains.plugins.terminal) is up to date: 1/1
[info] + PluginDependency(tanvd.grazi) is up to date: 1/1
[info] + PluginDependency(org.intellij.intelliLang) is up to date: 1/1
[info] + PluginDependency(org.jetbrains.bsp) is up to date: 15/15
[info] + PluginDependency(com.intellij.completion.ml.ranking) is up to date: 1/1
[info] + PluginDependency(com.intellij.copyright) is up to date: 1/1
[info] + PluginDependency(org.jetbrains.java.decompiler) is up to date: 1/1
[info] + PluginDependency(org.intellij.groovy) is up to date: 8/8
[info] + PluginDependency(com.intellij.properties) is up to date: 1/1
[info] + PluginDependency(training) is up to date: 1/1
[info] + PluginDependency(com.intellij.java-i18n) is up to date: 2/2
[info] + PluginDependency(org.jetbrains.kotlin) is up to date: 1/1
[success] Total time: 0 s, completed 4 Sept 2024, 8:31:26 am
[success] Total time: 0 s, completed 4 Sept 2024, 8:31:26 am
[warn] Plugin [com.intellij.java] is already included by: [JUnit] in project 'scala-impl'
[warn] Plugin [com.intellij.java] is already included by: [JUnit] in project 'bsp'
[warn] Plugin [com.intellij.java] is already included by: [JUnit] in project 'testing-support'
[warn] Plugin [com.intellij.java] is already included by: [org.jetbrains.bsp] in project 'intellij-bsp'
[warn] Plugin [com.intellij.java] is already included by: [JUnit] in project 'junit'
[warn] Plugin [com.intellij.java] is already included by: [JUnit] in project 'uast'
[warn] Plugin [com.intellij.properties] is already included by: [com.intellij.java-i18n] in project 'properties'
[warn] Plugin [com.intellij.java] is already included by: [JUnit, org.jetbrains.bsp] in project 'scalaCommunity'
[warn] Plugin [com.intellij.properties] is already included by: [org.jetbrains.idea.maven, com.intellij.java-i18n] in project 'scalaCommunity'
[info] Compiling 2 Kotlin sources to /Users/lihaoyi/Github/intellij-scala/scala/package-search-client/target/scala-3.3.3/classes ...
[info] Compiling 8 Kotlin sources to /Users/lihaoyi/Github/intellij-scala/sbt/sbt-impl/workspace-entities/target/scala-3.3.3/classes ...
[info] compiling 1 Scala source to /Users/lihaoyi/Github/intellij-scala/scala/worksheet-repl-interface-impls/impl_2_12/target/scala-2.12/classes ...
[info] Non-compiled module 'compiler-bridge_2.12' for Scala 2.12.12. Compiling...
error:
  bad constant pool index: 0 at pos: 49176/ Compile / compileIncremental 0s
     while compiling: <no file>pile / kotlinCompile 1s
        during phase: globalPhase=<no phase>, enteringPhase=<some phase>
     library version: version 2.12.12
    compiler version: version 2.12.12
  reconstructed args: -bootclasspath /Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.12/scala-library-2.12.12.jar -nowarn -classpath /Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.10.1/compiler-interface-1.10.1.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-interface/1.10.0/util-interface-1.10.0.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/compiler-bridge_2.12/1.10.1/compiler-bridge_2.12-1.10.1-sources.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.12.12/scala-compiler-2.12.12.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.12.12/scala-reflect-2.12.12.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.12/1.0.6/scala-xml_2.12-1.0.6.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/jline/jline/2.14.6/jline-2.14.6.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.12/jansi-1.12.jar -d /var/folders/rt/f1pd6fz92x3__6jg0cmgdd580000gn/T/sbt_d16c5b6

  last tree to typer: EmptyTree
       tree position: <unknown>
            tree tpe: <notype>
              symbol: null
           call site: <none> in <none>

== Source file context for tree position ==

error: scala.reflect.internal.FatalError:
  bad constant pool index: 0 at pos: 49176
     while compiling: <no file>
        during phase: globalPhase=<no phase>, enteringPhase=<some phase>
     library version: version 2.12.12
    compiler version: version 2.12.12
  reconstructed args: -bootclasspath /Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.12/scala-library-2.12.12.jar -nowarn -classpath /Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.10.1/compiler-interface-1.10.1.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-interface/1.10.0/util-interface-1.10.0.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/compiler-bridge_2.12/1.10.1/compiler-bridge_2.12-1.10.1-sources.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.12.12/scala-compiler-2.12.12.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.12.12/scala-reflect-2.12.12.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.12/1.0.6/scala-xml_2.12-1.0.6.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/jline/jline/2.14.6/jline-2.14.6.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.12/jansi-1.12.jar -d /var/folders/rt/f1pd6fz92x3__6jg0cmgdd580000gn/T/sbt_d16c5b6

  last tree to typer: EmptyTree
       tree position: <unknown>
            tree tpe: <notype>
              symbol: null
           call site: <none> in <none>

== Source file context for tree position ==


	at scala.reflect.internal.Reporting.abort(Reporting.scala:68)
	at scala.reflect.internal.Reporting.abort$(Reporting.scala:64)
	at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:28)
	at scala.tools.nsc.symtab.classfile.ClassfileParser$ConstantPool.errorBadIndex(ClassfileParser.scala:385)
	at scala.tools.nsc.symtab.classfile.ClassfileParser$ConstantPool.getExternalName(ClassfileParser.scala:249)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.readParamNames$1(ClassfileParser.scala:839)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.parseAttribute$1(ClassfileParser.scala:845)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.$anonfun$parseAttributes$7(ClassfileParser.scala:919)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.parseAttributes(ClassfileParser.scala:919)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.parseMethod(ClassfileParser.scala:621)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.$anonfun$parseClass$4(ClassfileParser.scala:534)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.parseClass(ClassfileParser.scala:534)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.$anonfun$parse$2(ClassfileParser.scala:160)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.$anonfun$parse$1(ClassfileParser.scala:146)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.parse(ClassfileParser.scala:129)
	at scala.tools.nsc.symtab.SymbolLoaders$ClassfileLoader.doComplete(SymbolLoaders.scala:333)
	at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:240)
	at scala.reflect.internal.Symbols$Symbol.completeInfo(Symbols.scala:1542)
	at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1514)
	at scala.reflect.internal.Definitions.scala$reflect$internal$Definitions$$enterNewMethod(Definitions.scala:49)
	at scala.reflect.internal.Definitions$DefinitionsClass.String_$plus$lzycompute(Definitions.scala:1134)
	at scala.reflect.internal.Definitions$DefinitionsClass.String_$plus(Definitions.scala:1134)
	at scala.reflect.internal.Definitions$DefinitionsClass.syntheticCoreMethods$lzycompute(Definitions.scala:1437)
	at scala.reflect.internal.Definitions$DefinitionsClass.syntheticCoreMethods(Definitions.scala:1419)
	at scala.reflect.internal.Definitions$DefinitionsClass.symbolsNotPresentInBytecode$lzycompute(Definitions.scala:1449)
	at scala.reflect.internal.Definitions$DefinitionsClass.symbolsNotPresentInBytecode(Definitions.scala:1449)
	at scala.reflect.internal.Definitions$DefinitionsClass.init(Definitions.scala:1505)
	at scala.tools.nsc.Global$Run.<init>(Global.scala:1207)
	at scala.tools.nsc.Driver.doCompile(Driver.scala:46)
	at scala.tools.nsc.MainClass.doCompile(Main.scala:32)
	at scala.tools.nsc.Driver.process(Driver.scala:67)
	at scala.tools.nsc.Main.process(Main.scala)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at sbt.internal.inc.RawCompiler.getReporter$1(RawCompiler.scala:56)
	at sbt.internal.inc.RawCompiler.apply(RawCompiler.scala:77)
	at sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$7(AnalyzingCompiler.scala:457)
	at sbt.internal.inc.AnalyzingCompiler$.handleCompilationError$1(AnalyzingCompiler.scala:432)
	at sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$5(AnalyzingCompiler.scala:453)
	at sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$5$adapted(AnalyzingCompiler.scala:448)
	at sbt.io.IO$.withTemporaryDirectory(IO.scala:496)
	at sbt.io.IO$.withTemporaryDirectory(IO.scala:506)
	at sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$2(AnalyzingCompiler.scala:448)
	at sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$2$adapted(AnalyzingCompiler.scala:440)
	at sbt.io.IO$.withTemporaryDirectory(IO.scala:496)
	at sbt.io.IO$.withTemporaryDirectory(IO.scala:506)
	at sbt.internal.inc.AnalyzingCompiler$.compileSources(AnalyzingCompiler.scala:440)
	at sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$3(ZincComponentCompiler.scala:280)
	at sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$3$adapted(ZincComponentCompiler.scala:262)
	at sbt.io.IO$.withTemporaryDirectory(IO.scala:496)
	at sbt.io.IO$.withTemporaryDirectory(IO.scala:506)
	at sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$2(ZincComponentCompiler.scala:262)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at sbt.internal.util.BufferedLogger.bufferQuietly(BufferedLogger.scala:160)
	at sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$1(ZincComponentCompiler.scala:262)
	at sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$1$adapted(ZincComponentCompiler.scala:259)
	at sbt.io.IO$.withTemporaryDirectory(IO.scala:496)
	at sbt.io.IO$.withTemporaryDirectory(IO.scala:506)
	at sbt.internal.inc.ZincComponentCompiler.compileAndInstall(ZincComponentCompiler.scala:259)
	at sbt.internal.inc.ZincComponentCompiler.$anonfun$compiledBridgeJar$1(ZincComponentCompiler.scala:227)
	at sbt.internal.inc.IfMissing$Define.run(IfMissing.scala:20)
	at sbt.internal.inc.ZincComponentManager.createAndCache$1(ZincComponentManager.scala:52)
	at sbt.internal.inc.ZincComponentManager.$anonfun$files$3(ZincComponentManager.scala:63)
	at sbt.internal.inc.ZincComponentManager.getOrElse$1(ZincComponentManager.scala:44)
	at sbt.internal.inc.ZincComponentManager.$anonfun$files$2(ZincComponentManager.scala:63)
	at sbt.internal.inc.ZincComponentManager$$anon$1.call(ZincComponentManager.scala:92)
	at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:113)
	at xsbt.boot.Locks$GlobalLock.withChannelRetries$1(Locks.scala:91)
	at xsbt.boot.Locks$GlobalLock.$anonfun$withFileLock$1(Locks.scala:119)
	at xsbt.boot.Using$.withResource(Using.scala:12)
	at xsbt.boot.Using$.apply(Using.scala:9)
	at xsbt.boot.Locks$GlobalLock.withFileLock(Locks.scala:119)
	at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:71)
	at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:59)
	at xsbt.boot.Locks$.apply0(Locks.scala:47)
	at xsbt.boot.Locks$.apply(Locks.scala:36)
	at sbt.internal.inc.ZincComponentManager.lock(ZincComponentManager.scala:92)
	at sbt.internal.inc.ZincComponentManager.$anonfun$lockSecondaryCache$1(ZincComponentManager.scala:89)
	at scala.Option.map(Option.scala:230)
	at sbt.internal.inc.ZincComponentManager.lockSecondaryCache(ZincComponentManager.scala:89)
	at sbt.internal.inc.ZincComponentManager.fromSecondary$1(ZincComponentManager.scala:61)
	at sbt.internal.inc.ZincComponentManager.$anonfun$files$6(ZincComponentManager.scala:67)
	at sbt.internal.inc.ZincComponentManager.getOrElse$1(ZincComponentManager.scala:44)
	at sbt.internal.inc.ZincComponentManager.$anonfun$files$5(ZincComponentManager.scala:67)
	at sbt.internal.inc.ZincComponentManager$$anon$1.call(ZincComponentManager.scala:92)
	at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:113)
	at xsbt.boot.Locks$GlobalLock.withChannelRetries$1(Locks.scala:91)
	at xsbt.boot.Locks$GlobalLock.$anonfun$withFileLock$1(Locks.scala:119)
	at xsbt.boot.Using$.withResource(Using.scala:12)
	at xsbt.boot.Using$.apply(Using.scala:9)
	at xsbt.boot.Locks$GlobalLock.withFileLock(Locks.scala:119)
	at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:71)
	at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:59)
	at xsbt.boot.Locks$.apply0(Locks.scala:47)
	at xsbt.boot.Locks$.apply(Locks.scala:36)
	at sbt.internal.inc.ZincComponentManager.lock(ZincComponentManager.scala:92)
	at sbt.internal.inc.ZincComponentManager.lockLocalCache(ZincComponentManager.scala:85)
	at sbt.internal.inc.ZincComponentManager.files(ZincComponentManager.scala:67)
	at sbt.internal.inc.ZincComponentManager.file(ZincComponentManager.scala:73)
	at sbt.internal.inc.ZincComponentCompiler.compiledBridgeJar(ZincComponentCompiler.scala:227)
	at sbt.internal.inc.ZincComponentCompiler$ZincCompilerBridgeProvider.compiledBridge(ZincComponentCompiler.scala:68)
	at sbt.internal.inc.ZincComponentCompiler$ZincCompilerBridgeProvider.fetchCompiledBridge(ZincComponentCompiler.scala:75)
	at sbt.internal.inc.AnalyzingCompiler.getDualLoader(AnalyzingCompiler.scala:354)
	at sbt.internal.inc.AnalyzingCompiler.getCompilerLoader(AnalyzingCompiler.scala:343)
	at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:87)
	at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$7(MixedAnalyzingCompiler.scala:194)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:249)
	at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:184)
	at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4$adapted(MixedAnalyzingCompiler.scala:164)
	at sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:239)
	at sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:164)
	at sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:212)
	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:534)
	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:534)
	at sbt.internal.inc.Incremental$.$anonfun$apply$3(Incremental.scala:178)
	at sbt.internal.inc.Incremental$.$anonfun$apply$3$adapted(Incremental.scala:176)
	at sbt.internal.inc.Incremental$$anon$2.run(Incremental.scala:454)
	at sbt.internal.inc.IncrementalCommon$CycleState.next(IncrementalCommon.scala:117)
	at sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:56)
	at sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:52)
	at sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:265)
	at sbt.internal.inc.Incremental$.$anonfun$incrementalCompile$8(Incremental.scala:409)
	at sbt.internal.inc.Incremental$.withClassfileManager(Incremental.scala:496)
	at sbt.internal.inc.Incremental$.incrementalCompile(Incremental.scala:396)
	at sbt.internal.inc.Incremental$.apply(Incremental.scala:170)
	at sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:534)
	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:488)
	at sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:332)
	at sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:425)
	at sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:137)
	at sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:2427)
	at sbt.Defaults$.$anonfun$compileIncrementalTask$2(Defaults.scala:2377)
	at sbt.internal.server.BspCompileTask$.$anonfun$compute$1(BspCompileTask.scala:41)
	at sbt.internal.io.Retry$.apply(Retry.scala:47)
	at sbt.internal.io.Retry$.apply(Retry.scala:29)
	at sbt.internal.io.Retry$.apply(Retry.scala:24)
	at sbt.internal.server.BspCompileTask$.compute(BspCompileTask.scala:41)
	at sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:2375)
	at scala.Function1.$anonfun$compose$1(Function1.scala:49)
	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:63)
	at sbt.std.Transform$$anon$4.work(Transform.scala:69)
	at sbt.Execute.$anonfun$submit$2(Execute.scala:283)
	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:24)
	at sbt.Execute.work(Execute.scala:292)
	at sbt.Execute.$anonfun$submit$1(Execute.scala:283)
	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
	at sbt.CompletionService$$anon$2.call(CompletionService.scala:65)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1570)
[info] Attempting to fetch org.scala-sbt:compiler-bridge_2.12:1.10.1.
[info] compiling 1 Scala source to /Users/lihaoyi/Github/intellij-scala/scala/worksheet-repl-interface-impls/impl_2_13_0/target/scala-2.13/classes ...
[info] Non-compiled module 'compiler-bridge_2.13' for Scala 2.13.0. Compiling...
error:
  bad constant pool index: 0 at pos: 491760 / Compile / compileIncremental 0s
     while compiling: <no file>pile / kotlinCompile 2s
        during phase: globalPhase=<no phase>, enteringPhase=<some phase>
     library version: version 2.13.0
    compiler version: version 2.13.0
  reconstructed args: -d /var/folders/rt/f1pd6fz92x3__6jg0cmgdd580000gn/T/sbt_4ca4a66e -nowarn -classpath /Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.0/scala-library-2.13.0.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.10.1/compiler-interface-1.10.1.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-interface/1.10.0/util-interface-1.10.0.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/compiler-bridge_2.13/1.10.1/compiler-bridge_2.13-1.10.1-sources.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.0/scala-compiler-2.13.0.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.13.0/scala-reflect-2.13.0.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/jline/jline/2.14.6/jline-2.14.6.jar

  last tree to typer: EmptyTree
       tree position: <unknown>
            tree tpe: <notype>
              symbol: null
           call site: <none> in <none>

== Source file context for tree position ==

error: scala.reflect.internal.FatalError:
  bad constant pool index: 0 at pos: 49176
     while compiling: <no file>
        during phase: globalPhase=<no phase>, enteringPhase=<some phase>
     library version: version 2.13.0
    compiler version: version 2.13.0
  reconstructed args: -d /var/folders/rt/f1pd6fz92x3__6jg0cmgdd580000gn/T/sbt_4ca4a66e -nowarn -classpath /Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.0/scala-library-2.13.0.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.10.1/compiler-interface-1.10.1.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/util-interface/1.10.0/util-interface-1.10.0.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/compiler-bridge_2.13/1.10.1/compiler-bridge_2.13-1.10.1-sources.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.0/scala-compiler-2.13.0.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.13.0/scala-reflect-2.13.0.jar:/Users/lihaoyi/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/jline/jline/2.14.6/jline-2.14.6.jar

  last tree to typer: EmptyTree
       tree position: <unknown>
            tree tpe: <notype>
              symbol: null
           call site: <none> in <none>

== Source file context for tree position ==


	at scala.reflect.internal.Reporting.abort(Reporting.scala:68)
	at scala.reflect.internal.Reporting.abort$(Reporting.scala:64)
	at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:28)
	at scala.tools.nsc.symtab.classfile.ClassfileParser$ConstantPool.errorBadIndex(ClassfileParser.scala:394)
	at scala.tools.nsc.symtab.classfile.ClassfileParser$ConstantPool.getExternalName(ClassfileParser.scala:249)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.readParamNames$1(ClassfileParser.scala:839)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.parseAttribute$1(ClassfileParser.scala:845)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.$anonfun$parseAttributes$6(ClassfileParser.scala:915)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.parseAttributes(ClassfileParser.scala:915)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.parseMethod(ClassfileParser.scala:621)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.parseClass(ClassfileParser.scala:534)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.$anonfun$parse$2(ClassfileParser.scala:161)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.$anonfun$parse$1(ClassfileParser.scala:147)
	at scala.tools.nsc.symtab.classfile.ClassfileParser.parse(ClassfileParser.scala:130)
	at scala.tools.nsc.symtab.SymbolLoaders$ClassfileLoader.doComplete(SymbolLoaders.scala:323)
	at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.$anonfun$complete$2(SymbolLoaders.scala:230)
	at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:228)
	at scala.reflect.internal.Symbols$Symbol.completeInfo(Symbols.scala:1544)
	at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1517)
	at scala.reflect.internal.Definitions.scala$reflect$internal$Definitions$$enterNewMethod(Definitions.scala:48)
	at scala.reflect.internal.Definitions$DefinitionsClass.String_$plus$lzycompute(Definitions.scala:1221)
	at scala.reflect.internal.Definitions$DefinitionsClass.String_$plus(Definitions.scala:1221)
	at scala.reflect.internal.Definitions$DefinitionsClass.syntheticCoreMethods$lzycompute(Definitions.scala:1505)
	at scala.reflect.internal.Definitions$DefinitionsClass.syntheticCoreMethods(Definitions.scala:1487)
	at scala.reflect.internal.Definitions$DefinitionsClass.symbolsNotPresentInBytecode$lzycompute(Definitions.scala:1518)
	at scala.reflect.internal.Definitions$DefinitionsClass.symbolsNotPresentInBytecode(Definitions.scala:1518)
	at scala.reflect.internal.Definitions$DefinitionsClass.init(Definitions.scala:1574)
	at scala.tools.nsc.Global$Run.<init>(Global.scala:1204)
	at scala.tools.nsc.Driver.doCompile(Driver.scala:47)
	at scala.tools.nsc.MainClass.doCompile(Main.scala:30)
	at scala.tools.nsc.Driver.process(Driver.scala:68)
	at scala.tools.nsc.Main.process(Main.scala)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at sbt.internal.inc.RawCompiler.getReporter$1(RawCompiler.scala:56)
	at sbt.internal.inc.RawCompiler.apply(RawCompiler.scala:77)
	at sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$7(AnalyzingCompiler.scala:457)
	at sbt.internal.inc.AnalyzingCompiler$.handleCompilationError$1(AnalyzingCompiler.scala:432)
	at sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$5(AnalyzingCompiler.scala:453)
	at sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$5$adapted(AnalyzingCompiler.scala:448)
	at sbt.io.IO$.withTemporaryDirectory(IO.scala:496)
	at sbt.io.IO$.withTemporaryDirectory(IO.scala:506)
	at sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$2(AnalyzingCompiler.scala:448)
	at sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$2$adapted(AnalyzingCompiler.scala:440)
	at sbt.io.IO$.withTemporaryDirectory(IO.scala:496)
	at sbt.io.IO$.withTemporaryDirectory(IO.scala:506)
	at sbt.internal.inc.AnalyzingCompiler$.compileSources(AnalyzingCompiler.scala:440)
	at sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$3(ZincComponentCompiler.scala:280)
	at sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$3$adapted(ZincComponentCompiler.scala:262)
	at sbt.io.IO$.withTemporaryDirectory(IO.scala:496)
	at sbt.io.IO$.withTemporaryDirectory(IO.scala:506)
	at sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$2(ZincComponentCompiler.scala:262)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at sbt.internal.util.BufferedLogger.bufferQuietly(BufferedLogger.scala:160)
	at sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$1(ZincComponentCompiler.scala:262)
	at sbt.internal.inc.ZincComponentCompiler.$anonfun$compileAndInstall$1$adapted(ZincComponentCompiler.scala:259)
	at sbt.io.IO$.withTemporaryDirectory(IO.scala:496)
	at sbt.io.IO$.withTemporaryDirectory(IO.scala:506)
	at sbt.internal.inc.ZincComponentCompiler.compileAndInstall(ZincComponentCompiler.scala:259)
	at sbt.internal.inc.ZincComponentCompiler.$anonfun$compiledBridgeJar$1(ZincComponentCompiler.scala:227)
	at sbt.internal.inc.IfMissing$Define.run(IfMissing.scala:20)
	at sbt.internal.inc.ZincComponentManager.createAndCache$1(ZincComponentManager.scala:52)
	at sbt.internal.inc.ZincComponentManager.$anonfun$files$3(ZincComponentManager.scala:63)
	at sbt.internal.inc.ZincComponentManager.getOrElse$1(ZincComponentManager.scala:44)
	at sbt.internal.inc.ZincComponentManager.$anonfun$files$2(ZincComponentManager.scala:63)
	at sbt.internal.inc.ZincComponentManager$$anon$1.call(ZincComponentManager.scala:92)
	at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:113)
	at xsbt.boot.Locks$GlobalLock.withChannelRetries$1(Locks.scala:91)
	at xsbt.boot.Locks$GlobalLock.$anonfun$withFileLock$1(Locks.scala:119)
	at xsbt.boot.Using$.withResource(Using.scala:12)
	at xsbt.boot.Using$.apply(Using.scala:9)
	at xsbt.boot.Locks$GlobalLock.withFileLock(Locks.scala:119)
	at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:71)
	at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:59)
	at xsbt.boot.Locks$.apply0(Locks.scala:47)
	at xsbt.boot.Locks$.apply(Locks.scala:36)
	at sbt.internal.inc.ZincComponentManager.lock(ZincComponentManager.scala:92)
	at sbt.internal.inc.ZincComponentManager.$anonfun$lockSecondaryCache$1(ZincComponentManager.scala:89)
	at scala.Option.map(Option.scala:230)
	at sbt.internal.inc.ZincComponentManager.lockSecondaryCache(ZincComponentManager.scala:89)
	at sbt.internal.inc.ZincComponentManager.fromSecondary$1(ZincComponentManager.scala:61)
	at sbt.internal.inc.ZincComponentManager.$anonfun$files$6(ZincComponentManager.scala:67)
	at sbt.internal.inc.ZincComponentManager.getOrElse$1(ZincComponentManager.scala:44)
	at sbt.internal.inc.ZincComponentManager.$anonfun$files$5(ZincComponentManager.scala:67)
	at sbt.internal.inc.ZincComponentManager$$anon$1.call(ZincComponentManager.scala:92)
	at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:113)
	at xsbt.boot.Locks$GlobalLock.withChannelRetries$1(Locks.scala:91)
	at xsbt.boot.Locks$GlobalLock.$anonfun$withFileLock$1(Locks.scala:119)
	at xsbt.boot.Using$.withResource(Using.scala:12)
	at xsbt.boot.Using$.apply(Using.scala:9)
	at xsbt.boot.Locks$GlobalLock.withFileLock(Locks.scala:119)
	at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:71)
	at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:59)
	at xsbt.boot.Locks$.apply0(Locks.scala:47)
	at xsbt.boot.Locks$.apply(Locks.scala:36)
	at sbt.internal.inc.ZincComponentManager.lock(ZincComponentManager.scala:92)
	at sbt.internal.inc.ZincComponentManager.lockLocalCache(ZincComponentManager.scala:85)
	at sbt.internal.inc.ZincComponentManager.files(ZincComponentManager.scala:67)
	at sbt.internal.inc.ZincComponentManager.file(ZincComponentManager.scala:73)
	at sbt.internal.inc.ZincComponentCompiler.compiledBridgeJar(ZincComponentCompiler.scala:227)
	at sbt.internal.inc.ZincComponentCompiler$ZincCompilerBridgeProvider.compiledBridge(ZincComponentCompiler.scala:68)
	at sbt.internal.inc.ZincComponentCompiler$ZincCompilerBridgeProvider.fetchCompiledBridge(ZincComponentCompiler.scala:75)
	at sbt.internal.inc.AnalyzingCompiler.getDualLoader(AnalyzingCompiler.scala:354)
	at sbt.internal.inc.AnalyzingCompiler.getCompilerLoader(AnalyzingCompiler.scala:343)
	at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:87)
	at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$7(MixedAnalyzingCompiler.scala:194)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:249)
	at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:184)
	at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4$adapted(MixedAnalyzingCompiler.scala:164)
	at sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:239)
	at sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:164)
	at sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:212)
	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:534)
	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:534)
	at sbt.internal.inc.Incremental$.$anonfun$apply$3(Incremental.scala:178)
	at sbt.internal.inc.Incremental$.$anonfun$apply$3$adapted(Incremental.scala:176)
	at sbt.internal.inc.Incremental$$anon$2.run(Incremental.scala:454)
	at sbt.internal.inc.IncrementalCommon$CycleState.next(IncrementalCommon.scala:117)
	at sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:56)
	at sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:52)
	at sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:265)
	at sbt.internal.inc.Incremental$.$anonfun$incrementalCompile$8(Incremental.scala:409)
	at sbt.internal.inc.Incremental$.withClassfileManager(Incremental.scala:496)
	at sbt.internal.inc.Incremental$.incrementalCompile(Incremental.scala:396)
	at sbt.internal.inc.Incremental$.apply(Incremental.scala:170)
	at sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:534)
	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:488)
	at sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:332)
	at sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:425)
	at sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:137)
	at sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:2427)
	at sbt.Defaults$.$anonfun$compileIncrementalTask$2(Defaults.scala:2377)
	at sbt.internal.server.BspCompileTask$.$anonfun$compute$1(BspCompileTask.scala:41)
	at sbt.internal.io.Retry$.apply(Retry.scala:47)
	at sbt.internal.io.Retry$.apply(Retry.scala:29)
	at sbt.internal.io.Retry$.apply(Retry.scala:24)
	at sbt.internal.server.BspCompileTask$.compute(BspCompileTask.scala:41)
	at sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:2375)
	at scala.Function1.$anonfun$compose$1(Function1.scala:49)
	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:63)
	at sbt.std.Transform$$anon$4.work(Transform.scala:69)
	at sbt.Execute.$anonfun$submit$2(Execute.scala:283)
	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:24)
	at sbt.Execute.work(Execute.scala:292)
	at sbt.Execute.$anonfun$submit$1(Execute.scala:283)
	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
	at sbt.CompletionService$$anon$2.call(CompletionService.scala:65)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1570)
[info] Attempting to fetch org.scala-sbt:compiler-bridge_2.13:1.10.1.
[warn] /Users/lihaoyi/Github/intellij-scala/sbt/sbt-impl/workspace-entities/gen/com/intellij/entities/impl/SbtModuleEntityImpl.kt: 46, 26: 'extractOneToAbstractOneParent(ConnectionId, WorkspaceEntity): Parent?' is deprecated. Use the method from the instrumentation API
[warn] /Users/lihaoyi/Github/intellij-scala/sbt/sbt-impl/workspace-entities/gen/com/intellij/entities/impl/SbtModuleEntityImpl.kt: 110, 27: 'extractOneToAbstractOneParent(ConnectionId, WorkspaceEntity.Builder<out WorkspaceEntity>): WorkspaceEntity.Builder<out WorkspaceEntity>?' is deprecated. Use the method from the instrumentation API
[warn] /Users/lihaoyi/Github/intellij-scala/sbt/sbt-impl/workspace-entities/gen/com/intellij/entities/impl/SbtModuleEntityImpl.kt: 171, 25: Check for instance is always 'true'
[warn] /Users/lihaoyi/Github/intellij-scala/sbt/sbt-impl/workspace-entities/gen/com/intellij/entities/impl/SbtModuleEntityImpl.kt: 175, 43: Unchecked cast: ModuleEntity.Builder to ModifiableWorkspaceEntityBase<WorkspaceEntity, *>
[warn] /Users/lihaoyi/Github/intellij-scala/sbt/sbt-impl/workspace-entities/gen/com/intellij/entities/impl/SbtModuleEntityImpl.kt: 178, 27: 'updateOneToAbstractOneParentOfChild(ConnectionId, WorkspaceEntity.Builder<out WorkspaceEntity>, WorkspaceEntity.Builder<out WorkspaceEntity>?): Unit' is deprecated. Use the method from the instrumentation API
[warn] /Users/lihaoyi/Github/intellij-scala/sbt/sbt-impl/workspace-entities/gen/com/intellij/entities/impl/SharedSourcesOwnersEntityImpl.kt: 47, 26: 'extractOneToAbstractOneParent(ConnectionId, WorkspaceEntity): Parent?' is deprecated. Use the method from the instrumentation API
[warn] /Users/lihaoyi/Github/intellij-scala/sbt/sbt-impl/workspace-entities/gen/com/intellij/entities/impl/SharedSourcesOwnersEntityImpl.kt: 99, 27: 'extractOneToAbstractOneParent(ConnectionId, WorkspaceEntity.Builder<out WorkspaceEntity>): WorkspaceEntity.Builder<out WorkspaceEntity>?' is deprecated. Use the method from the instrumentation API
[warn] /Users/lihaoyi/Github/intellij-scala/sbt/sbt-impl/workspace-entities/gen/com/intellij/entities/impl/SharedSourcesOwnersEntityImpl.kt: 160, 25: Check for instance is always 'true'
[warn] /Users/lihaoyi/Github/intellij-scala/sbt/sbt-impl/workspace-entities/gen/com/intellij/entities/impl/SharedSourcesOwnersEntityImpl.kt: 164, 43: Unchecked cast: ModuleEntity.Builder to ModifiableWorkspaceEntityBase<WorkspaceEntity, *>
[warn] /Users/lihaoyi/Github/intellij-scala/sbt/sbt-impl/workspace-entities/gen/com/intellij/entities/impl/SharedSourcesOwnersEntityImpl.kt: 167, 27: 'updateOneToAbstractOneParentOfChild(ConnectionId, WorkspaceEntity.Builder<out WorkspaceEntity>, WorkspaceEntity.Builder<out WorkspaceEntity>?): Unit' is deprecated. Use the method from the instrumentation API
[warn] /Users/lihaoyi/Github/intellij-scala/sbt/sbt-impl/workspace-entities/gen/com/intellij/entities/impl/SharedSourcesOwnersEntityImpl.kt: 179, 78: Parameter 'value' is never used, could be renamed to _
[error] (worksheet-repl-interface-impl_2_13_0 / Compile / compileIncremental) Error compiling the sbt component 'compiler-bridge_2.13'
[error] (worksheet-repl-interface-impl_2_12 / Compile / compileIncremental) Error compiling the sbt component 'compiler-bridge_2.12'
[error] Total time: 9 s, completed 4 Sept 2024, 8:31:35 am

@unkarjedy
Copy link
Member

@lihaoyi
Hello

I'm having trouble testing this on my laptop, with the readme's packaging instructions giving me the following error

I notice you use JDK 22

(Homebrew Java 22.0.2)

Please try using JDK 17 according to this part of the readme

Prerequisites

In order to take part in Scala plugin development, you need:
2. JDK 17 (you can download it via IntelliJ IDEA)

If you have some suggestions how make the readme more clear we are happy to do listen to them.

@unkarjedy
Copy link
Member

A proper way to do it would be to not directly piggy-back on the "ScalaFileType" but to register a dedicated mill file type and mill language, which would be a dialect of the scala.
One of the advantages of it would be e.g. the ability to create a dedicated icon for the file type.

You can see some examples:

  • org.jetbrains.sbt.language.SbtFileType
    org.jetbrains.sbt.language.SbtLanguage
  • org.jetbrains.plugins.scala.worksheet.WorksheetFileType
    org.jetbrains.plugins.scala.worksheet.WorksheetLanguage

I would suggest creating a separate module mill similar to sbt near sbt directory (single module would be enough for now).
But for a start you could do it at least in a separate package.

@lihaoyi
Copy link
Contributor Author

lihaoyi commented Sep 9, 2024

Thanks for the review @unkarjedy ! will give it a shot

@lihaoyi
Copy link
Contributor Author

lihaoyi commented Sep 10, 2024

@unkarjedy I got the local build working and tried your suggested approach. It mostly works, except for one issue where the package declarations don't seem to be parsing properly:

Screenshot 2024-09-10 at 12 02 30 PM

I did some investigating, and found that ScPackageImpls are not being instantiated for the package declaration in my .mill files, although they are being instantiated for package declaration in Scala files. Do you have any idea why that would be the case?


Another follow up question: is there some way to ensure we inherit all of ScalaLanguage/ScalaFileType/etc.'s functionality? I notice there are a lot of things configured in scala-plugin-common.xml for completion and whatnot. How do I ensure that I get all the same things in my mill.xml?

@azdrojowa123
Copy link
Contributor

azdrojowa123 commented Sep 10, 2024

@lihaoyi
Could you send me a demo project on which you are working with this new Mill feature? I have a problem with set-up.
I would be grateful

@unkarjedy
Copy link
Member

unkarjedy commented Sep 10, 2024

@lihaoyi

ScPackageImpls are not being instantiated for the package declaration in my .mill files, although they are being instantiated for package declaration in Scala files. Do you have any idea why that would be the case?

It seems the root cause is because the file is not located in the module source root.
In a normal case, when ordinary .scala file is located in a source root a ScSyntheticPackage is being created (see ScSyntheticPackage#apply) and later ScPackageImpl is created from it (see ScPackageImpl#apply).
When the file is not inside a source root, ScPackageImpl is not created, it's the same for .scala and .java files.
But the difference is that for Scala and Java files the highlighting outside source root is suppressed (you can see it in the top-right corner indicator)
image

This suppression for Scala and Java files is done in org.jetbrains.plugins.scala.annotator.ScalaProblemHighlightFilter#shouldHighlight
and com.intellij.codeInsight.daemon.JavaProblemHighlightFilter#shouldHighlight
There is also org.jetbrains.sbt.codeinsight.daemon.SbtProblemHighlightFilter#shouldHighlight.

Do the build files really need defining packages?
In that case org.jetbrains.plugins.scala.lang.psi.impl.toplevel.synthetic.ScSyntheticPackage#apply should be somehow adapted.
Or you might implement your own com.intellij.psi.PsiElementFinder#PsiElementFinder similar to org.jetbrains.plugins.scala.finder.ScalaClassFinder#findPackage

@unkarjedy
Copy link
Member

@lihaoyi

Another follow up question: is there some way to ensure we inherit all of ScalaLanguage/ScalaFileType/etc.'s functionality? I notice there are a lot of things configured in scala-plugin-common.xml for completion and whatnot. How do I ensure that I get all the same things in my mill.xml?

You can look at these classes usages for exampeles:
org.jetbrains.plugins.scala.worksheet.WorksheetFileType
org.jetbrains.plugins.scala.worksheet.WorksheetLanguage
org.jetbrains.sbt.language.SbtFileType
org.jetbrains.sbt.language.SbtLanguage

Pretty much all the features from .scala files work in worksheets as well.

You also need to ensure that .mill files are located in a source root.

Also, for SBT files we do some hacks in
org.jetbrains.sbt.language.psi.search.SbtBuildModuleUseScopeEnlarger
org.jetbrains.sbt.language.SbtFileImpl#getFileResolveScope

@lihaoyi
Copy link
Contributor Author

lihaoyi commented Sep 10, 2024

@azdrojowa123 here's a zip:

test.zip

You can see the documentation for this new Mill multi-file build layout here https://mill-build.org/mill/Structuring_Large_Builds.html#_multi_file_builds

@unkarjedy the approach is trying and be as compatible as possible with normal Scala, to minimize special casing in the IDE. So as of now the feature asks that users write package statements at the top of every file. But if that can be worked around somehow, then the need for package statements can be dropped. But the IDE would need to understand somehow that the filesystem folder hierarchy serves as the JVM package hierarchy

I will take a look at the classes you mentioned and get back to you. Thank you for the pointers!

@lihaoyi
Copy link
Contributor Author

lihaoyi commented Sep 11, 2024

@unkarjedy I did some further investigation, and my current lead is that this call to StubIndex.getElements returns an empty list for *.mill files but returns a non-empty list for *.scala files, all else being equal:

StubIndex.getElements(getKey, keyPreprocessed, project, scalaScope, requiredClass)

It seems that we're trying to look up org.jetbrains.plugins.scala.lang.psi.api.toplevel.ScPackaging instances in some kind of global index to get a list of packages present on the filesystem, and it's only working when the files have the .scala extension. I've tried printing all the arguments to StubIndex.getElements and the primitive ones appear to all have the same value (getKey, keyProcessed, requiredClass) and the abstract ones I instrumented and seem to return the same value for all the methods that I could find getting called (scalaScope)

Apart from instrumenting to find runtime behavioral differences, I also tried to add MillFileType and MillLanguage anywhere I found ScalaFileType and ScalaLanguage in ScalaFilterScope.scala, but none of those have resulted in a noticeable change in behavior

What do you suggest as the next avenues of investigation? It seems to me that there is only one possibility: one of the arguments to StubIndex.getElements behaves differently between .mill and .scala files, and I just haven't managed to figure out which one yet. But I thought I should ask to see if you guys could give any more pointers before I proceed with further digging

@azdrojowa123
Copy link
Contributor

azdrojowa123 commented Sep 11, 2024

@lihaoyi
I have checked your code and after setting ScalaSDK in mill-build_ module eveything works correctly.
The question now is why ScalaSDK is not added automatically. It should.
Does it work the same for you?
Screenshot 2024-09-11 at 10 41 04

@unkarjedy wrote

It seems the root cause is because the file is not located in the module source root.

But I see that package.mill objects are added to the source roots in mill-build_ module.
Screenshot 2024-09-11 at 10 40 11

@lihaoyi
Copy link
Contributor Author

lihaoyi commented Sep 12, 2024

@azdrojowa123 I tried setting the SDK via the prompt in the main editor, but it still doesn't seem to be resolving packages correctly. How did you set the SDK?
Screenshot 2024-09-12 at 11 46 03 AM

Screenshot 2024-09-12 at 11 46 19 AM

@lihaoyi
Copy link
Contributor Author

lihaoyi commented Sep 12, 2024

I am testing the plugin via the scalaCommunity run configuration on the intellij-scala repo

@azdrojowa123
Copy link
Contributor

@azdrojowa123 I tried setting the SDK via the prompt in the main editor, but it still doesn't seem to be resolving packages correctly. How did you set the SDK?

I set it in the same way, but I was setting a Scala 3 version.

Yesterday we had a conversation in the team about supporting .mill files and we came up with another idea to solve this problem. The idea is to not create a new language, but to just register a .mill extension as a Scala file.
I implemented POC of such solution. It's present on branch support-mill-extension-as-Scala-file.
Could you check whether it works for you? Unfortunately, you will also have to add a Scala SKD manually.

According to the build.mill file, the desired scala version for this project is Scala 2.
Why is it that when the SDK is set with Scala 2 such errors are displayed? Are they expected?
Screenshot 2024-09-12 at 10 36 58

@lihaoyi
Copy link
Contributor Author

lihaoyi commented Sep 12, 2024

Registering .mill as a Scala file extension would work great for me!

@lihaoyi
Copy link
Contributor Author

lihaoyi commented Sep 12, 2024

@azdrojowa123 We expect to keep as compatible with Scala as possible, to minimize the maintenance burden of maintaining a fork of the language, so hopefully that would apply inside IntelliJ as well where we would be able to be treated like vanilla Scala files just with a different extension

@azdrojowa123
Copy link
Contributor

@lihaoyi
So I understand that you've tested the code on support-mill-extension-as-Scala-file?
If yes, then I will clean the code and we could change the branch in this PR.

@lihaoyi
Copy link
Contributor Author

lihaoyi commented Sep 12, 2024

@azdrojowa123 I tried checking out your branch

commit 452ea7b7f1b4d196979aae6920b0b7c2a772bdbe (HEAD -> support-mill-extension-as-Scala-file)
Author: Aleksandra Zdrojowa <aleksandra.zdrojowa@jetbrains.com>
Date:   Thu Sep 12 10:46:55 2024 +0200

    supporting .mill files - the approach with the new extension to the Scala file

But I'm not seeing the files being picked up as Scala files:

Screenshot 2024-09-12 at 8 10 19 PM

@azdrojowa123
Copy link
Contributor

azdrojowa123 commented Sep 12, 2024

Really strange.
Can you before running the ScalaCommunity configuration rebuild the project and rebuild the artifacts (Build -> Build Artifacts...)?
Screenshot 2024-09-12 at 14 18 34

@lihaoyi
Copy link
Contributor Author

lihaoyi commented Sep 12, 2024

@azdrojowa123 tried that, no luck. git clean -xdf on the intellij-scala repo didn't help either. Is there other stuff I need to clean?

@lihaoyi
Copy link
Contributor Author

lihaoyi commented Sep 12, 2024

tried invalidate caches and restart on both the intellij-scala IDE and on the spawned test IDE, neither helped. Is there anything I can look at to help debug?

@azdrojowa123
Copy link
Contributor

Yes. Please type in the project root find . -type d -name 'target' -exec rm -rf {} \;, then reimport and rebuild again.
If you get an error "BuildInfo is already defined..." then please remove duplicated generated sources in module bsp and sbt-api (you should do in the Project Structure).

if that doesn't work we can call :)

@azdrojowa123
Copy link
Contributor

@lihaoyi
I found the issue it was on my side.
I will try to push a fix soon.

@azdrojowa123
Copy link
Contributor

I pushed the fix, you can check now.
Please rebuild the artifacts before running :)

@lihaoyi
Copy link
Contributor Author

lihaoyi commented Sep 12, 2024

@azdrojowa123 I tried it out. IntelliJ now correctly identifies the .mill files as Mill files, with the correct icon, but it still does not correctly highlight the package statements at the top of each file:

Screenshot 2024-09-12 at 10 03 40 PM

Notably, if I go to Settings / Editor / File Types / Scala and add *.mill as an association to the Scala file type, IntelliJ does successfully highlight the package statements. So we know IntelliJ is able to do this, just need to figure out how to set up the association correctly

@azdrojowa123
Copy link
Contributor

That's strange because for me, the packages work anyway.
But anyway, the mill extension should be displayed in Settings / Editor / File Types / Scala. I'll take care of it.

@lihaoyi
Copy link
Contributor Author

lihaoyi commented Sep 12, 2024

When I open the project I did not see the *.mill extension association in settings unless i manually add it. Do you see it? I wonder if the problem is somewhere thete

@azdrojowa123
Copy link
Contributor

No I also don't see it.

@lihaoyi
Copy link
Contributor Author

lihaoyi commented Sep 12, 2024

Maybe try getting someone else on your team to try? At least then we'll know if the problem is in my setup or yours and can proceed to investigate from there

@azdrojowa123
Copy link
Contributor

azdrojowa123 commented Sep 13, 2024

@lihaoyi
Before testing my latest changes yesterday, did you manually add, and later remove, the .mil extension in the Scala file type?
I did so (only for testing purpose), and because of it on my machine mill extension is saved in the cache as "removed" and for this reason it is not displayed in the Settings / Editor / File Types / Scala. I'm contacting the platform team about this issue.

@lihaoyi
Copy link
Contributor Author

lihaoyi commented Sep 13, 2024

I definitey did add and remove and file type multiple times. I did try invalidate caches and restart though, which I thought is meant to clear all such transient state?

@azdrojowa123
Copy link
Contributor

Unfortunately invalidate caches and restart is not enough in this case.
You should go to ~/.ScalaPluginIU/config/options/filetypes.xml and remove such entry
<removed_mapping ext="mill" approved="true" type="Scala" />.
I apologise for the inconvenience with it.

Then you can try the code again (please pull the latest changes, because I have added some logic).

Does this solution suit you?
There is still one thing to implement - removing org.jetbrains.plugins.scala.LanguageFileTypeBase#isMyFileType, because it is an incorrect approach, but I will take care of it :)

@lihaoyi
Copy link
Contributor Author

lihaoyi commented Sep 13, 2024

@azdrojowa123 I just tried rm -rf ~/.ScalaPluginIU/config/options/filetypes.xml, and it works now! Package statements highlight correctly!
Screenshot 2024-09-13 at 9 01 50 PM

The remaining highlighting issues are expected: Mill files do differ in minor ways from normal Scala: e.g. the override keyword is optional in Mill files, and there are a few extra implicits in scope (which is what RootModule(...) ends up picking up). There are also a few others, like package objects foo.bar.qux can be referenced using just their package path without the .package suffix

I think the next steps are as follows:

  1. For now, go with your PR to make .mill a file extension associated with Scala files. That will get us 90% of the way to perfect support and will unblock immediate usage of `.mill files

  2. Following up, see what can be done to improve support from there to add support for the quirks listed above. Whether that's adding some special cases for Scala language in Mill files, or whether that's adding a new MillLanguage. Either way works, but that's a more long term effort (months-to-years) that shouldn't block the immediate file extension association you have in your support-mill-extension-as-Scala-file branch

@azdrojowa123
Copy link
Contributor

azdrojowa123 commented Sep 13, 2024

@lihaoyi
Thank you.
I will open a new PR from support-mill-extension-as-Scala-file and link it here for context.
#667

Regarding your 2. point -> If you want to add some special support for mill files then the approach with the new MillLanguage should be accurate.

@lihaoyi
Copy link
Contributor Author

lihaoyi commented Sep 26, 2024

Closing for now in favor of #667

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants