Skip to content

Commit

Permalink
bugfix: Don't send best effort flag when disabled
Browse files Browse the repository at this point in the history
I don't think this changes anything as we did also set build server config, but just in case.
  • Loading branch information
tgodzik committed Nov 25, 2024
1 parent 35af524 commit cb68617
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ final class Compilations(
onStartCompilation: () => Unit,
userConfiguration: () => UserConfiguration,
downstreamTargets: PreviouslyCompiledDownsteamTargets,
bestEffortEnabled: Boolean,
)(implicit ec: ExecutionContext) {
private val compileTimeout: Timeout =
Timeout("compile", Duration(10, TimeUnit.MINUTES))
Expand Down Expand Up @@ -266,12 +267,12 @@ final class Compilations(
scribe.debug("Compiling " + targets.mkString(", "))
val originId = "METALS-$" + UUID.randomUUID().toString
val params = new b.CompileParams(targets.asJava)
val addBestEffort =
(connection.isBloop || connection.isScalaCLI) && bestEffortEnabled
params.setOriginId(originId)
if (
userConfiguration().verboseCompilation && (connection.isBloop || connection.isScalaCLI)
) {
if (userConfiguration().verboseCompilation && addBestEffort) {
params.setArguments(List("--verbose", "--best-effort").asJava)
} else if (connection.isBloop || connection.isScalaCLI) {
} else if (addBestEffort) {
params.setArguments(List("--best-effort").asJava)
} else params.setArguments(Nil.asJava)
targets.foreach { target =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ abstract class MetalsLspService(
onStartCompilation,
() => userConfig,
downstreamTargets,
clientConfig.initialConfig.enableBestEffort,
)
var indexingPromise: Promise[Unit] = Promise[Unit]()
def buildServerPromise: Promise[Unit]
Expand Down

0 comments on commit cb68617

Please sign in to comment.