Skip to content

Commit

Permalink
don't remove downstream diagnostics for best effort compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek committed Jul 22, 2024
1 parent 7b85d2a commit 4971acd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class Compilations(
workspace: () => AbsolutePath,
languageClient: MetalsLanguageClient,
refreshTestSuites: () => Unit,
afterSuccesfulCompilation: () => Unit,
afterSuccessfulCompilation: () => Unit,
isCurrentlyFocused: b.BuildTargetIdentifier => Boolean,
compileWorksheets: Seq[AbsolutePath] => Future[Unit],
onStartCompilation: () => Unit,
Expand Down Expand Up @@ -269,7 +269,7 @@ final class Compilations(
val result = compilation.asScala
.andThen { case result =>
updateCompiledTargetState(result)
afterSuccesfulCompilation()
afterSuccessfulCompilation()

// See https://github.com/scalacenter/bloop/issues/1067
classes.rebuildIndex(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ final class Diagnostics(
): Unit = {
val target = report.getTarget()

if (statusCode.isError) {
// if we use best effort compilation downstream targets
// should get recompiled even if compilation fails
def shouldUnpublishForDownstreamTargets =
!buildTargets.scalaTarget(target).exists(_.isBestEffort)
if (statusCode.isError && shouldUnpublishForDownstreamTargets) {
removeInverseDependenciesDiagnostics(target)
} else {
buildTargetMapper.remove(target)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class BestEffortCompilationSuite
} yield ()
}

// we check if previous sucessful best effort compilation artefacts remain
// we check if previous successful best effort compilation artifacts remain
// after an unsuccessful best effort attempt.
// Unsuccessful best effort attempts tend surface detailed exceptions
// from bloop, so those will show up while this test is running.
Expand Down

0 comments on commit 4971acd

Please sign in to comment.