Skip to content

Commit 2386f45

Browse files
committed
Merge branch 'master' into lsp
2 parents 121d530 + 1a266b5 commit 2386f45

6 files changed

Lines changed: 9 additions & 40 deletions

File tree

project/plugins.sbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Any copyright is dedicated to the Public Domain.
22
// http://creativecommons.org/publicdomain/zero/1.0/
33

4-
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0")
5-
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.7.6")
6-
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0")
4+
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.3.1")
5+
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.11.1")
6+
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.13.1")

src/main/scala/viper/server/core/AstWorker.scala

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ import viper.server.utility.AstGenerator
1212
import viper.server.vsi.AstConstructionException
1313
import viper.silver.ast.Program
1414
import viper.silver.ast.utility.FileLoader
15-
import viper.silver.reporter.{Entity, ExceptionReport}
16-
import viper.silver.verifier.VerificationResult
15+
import viper.silver.reporter.ExceptionReport
1716

1817

1918
object ViperFileNotFoundException extends AstConstructionException
@@ -65,10 +64,5 @@ class AstWorker(val file: String,
6564
ast_option
6665
}
6766

68-
override def mapEntityVerificationResult(entity: Entity, result: VerificationResult): VerificationResult = {
69-
logger.error(s"unexpected operation: AstWorker received an entity success or entity failure message, which should not occur while constructing a Viper AST")
70-
???
71-
}
72-
7367
override def call(): Option[Program] = constructAst(args)
7468
}

src/main/scala/viper/server/core/MessageReportingTask.scala

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ package viper.server.core
88

99
import ch.qos.logback.classic.Logger
1010
import viper.server.vsi.MessageStreamingTask
11-
import viper.silver.reporter.{Entity, EntityFailureMessage, EntitySuccessMessage, Message, Reporter, Time, VerificationResultMessage}
11+
import viper.silver.reporter.{Entity, EntityFailureMessage, EntitySuccessMessage, Message, PluginAwareReporter, Time, VerificationResultMessage}
1212
import viper.silver.verifier.{Success, VerificationResult}
1313

1414
trait MessageReportingTask[T] extends MessageStreamingTask[T] with ViperPost {
@@ -24,34 +24,18 @@ trait MessageReportingTask[T] extends MessageStreamingTask[T] with ViperPost {
2424
super.registerTaskEnd(success, logger)
2525
}
2626

27-
/** implementations of this functions should let plugins map verification results for each entity */
28-
def mapEntityVerificationResult(entity: Entity, result: VerificationResult): VerificationResult
29-
30-
private def processEntityResultMessage(verifier: String, entity: Entity,
31-
verificationTime: Time, result: VerificationResult, cached: Boolean): Unit = {
32-
val mappedResult = mapEntityVerificationResult(entity, result)
33-
enqueueMessage(VerificationResultMessage(verifier, entity, verificationTime, mappedResult, cached))
34-
}
35-
3627
// Implementation of the Reporter interface used by the backend.
37-
class ActorReporter(tag: String) extends Reporter {
28+
class ActorReporter(tag: String) extends PluginAwareReporter {
3829
val name = s"ViperServer_$tag"
3930

40-
def report(msg: Message): Unit = {
31+
def doReport(msg: Message): Unit = {
4132
logger.trace(s"ActorReport received msg $msg")
4233
msg match {
4334
case m: EntityFailureMessage if m.concerning.info.isCached =>
4435
case m: EntitySuccessMessage if m.concerning.info.isCached =>
4536
// Do not re-send messages about AST nodes that have been cached;
4637
// the information about these nodes is going to be reported anyway.
4738

48-
// to properly support streaming of (partial) verification results, we must invoke
49-
// the plugins to do the post-processing and enqueue the resulting message:
50-
case EntitySuccessMessage(verifier, entity, verificationTime, cached) =>
51-
processEntityResultMessage(verifier, entity, verificationTime, Success, cached)
52-
case EntityFailureMessage(verifier, entity, verificationTime, failure, cached) =>
53-
processEntityResultMessage(verifier, entity, verificationTime, failure, cached)
54-
5539
case m =>
5640
enqueueMessage(m)
5741
}

src/main/scala/viper/server/core/VerificationWorker.scala

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ class VerificationWorker(private val command: List[String],
102102
}
103103
}
104104

105-
override def mapEntityVerificationResult(entity: Entity, result: VerificationResult): VerificationResult = {
106-
backend.mapEntityVerificationResult(entity, result)
107-
}
108-
109105
override def call(): Unit = run()
110106
}
111107

@@ -253,11 +249,6 @@ class ViperBackend(val backendName: String, private val _frontend: SilFrontend,
253249
private def verification(input: Program): Either[Seq[AbstractError], VerificationResult] =
254250
Right(_frontend.verifier.verify(input))
255251

256-
def mapEntityVerificationResult(entity: Entity, verificationResult: VerificationResult): VerificationResult = {
257-
if (disablePlugins) verificationResult
258-
else _frontend.plugins.mapEntityVerificationResult(entity, verificationResult)
259-
}
260-
261252
private def mapVerificationResult(input: Program, result: VerificationResult): VerificationResult =
262253
if (disablePlugins) result
263254
else _frontend.plugins.mapVerificationResult(input, result)

0 commit comments

Comments
 (0)