Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek committed Apr 26, 2024
1 parent 1499749 commit b8e8fc4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions metals/src/main/scala/scala/meta/internal/metals/Compilers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ class Compilers(

import compilerConfiguration._

val plugins = new CompilerPlugins()
private val outlineFilesProvider =
new OutlineFilesProvider(buildTargets, buffers)

Expand Down Expand Up @@ -967,7 +966,15 @@ class Compilers(
.inverseSources(path)

target match {
case None => Some(fallbackCompiler)
case None =>
val tmpDirectory = workspace.resolve(Directories.tmp)
val scalaVersion =
scalaVersionSelector.fallbackScalaVersion(isAmmonite = false)
if (!path.toNIO.startsWith(tmpDirectory.toNIO))
scribe.info(
s"no build target found for $path. Using presentation compiler with project's scala-library version: ${scalaVersion}"
)
Some(fallbackCompiler)
case Some(value) =>
if (path.isScalaFilename) loadCompiler(value)
else if (path.isJavaFilename && forceScala)
Expand Down

0 comments on commit b8e8fc4

Please sign in to comment.