Skip to content

Commit

Permalink
use enableBestEffort setting
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek committed Aug 5, 2024
1 parent 7f85c0b commit 756bea0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ final class Diagnostics(
trees: Trees,
buildTargets: BuildTargets,
downstreamTargets: PreviouslyCompiledDownsteamTargets,
config: MetalsServerConfig,
) {
private val diagnostics =
TrieMap.empty[AbsolutePath, ju.Queue[Diagnostic]]
Expand Down Expand Up @@ -98,7 +99,9 @@ final class Diagnostics(
// if we use best effort compilation downstream targets
// should get recompiled even if compilation fails
def shouldUnpublishForDownstreamTargets =
!buildTargets.scalaTarget(target).exists(_.isBestEffort)
!(buildTargets
.scalaTarget(target)
.exists(_.isBestEffort) && config.enableBestEffort)
if (statusCode.isError && shouldUnpublishForDownstreamTargets) {
removeInverseDependenciesDiagnostics(target)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ abstract class MetalsLspService(
trees,
buildTargets,
downstreamTargets,
initialServerConfig,
)

protected def semanticdbs(): Semanticdbs
Expand Down

0 comments on commit 756bea0

Please sign in to comment.