clarified types;
authorwenzelm
Thu, 10 Dec 2020 17:01:59 +0100
changeset 72872 530534f2f0fd
parent 72871 17533d0a11b8
child 72873 0ad513706a27
clarified types;
src/Pure/PIDE/rendering.scala
--- a/src/Pure/PIDE/rendering.scala	Thu Dec 10 17:01:14 2020 +0100
+++ b/src/Pure/PIDE/rendering.scala	Thu Dec 10 17:01:59 2020 +0100
@@ -543,32 +543,25 @@
   def text_messages(range: Text.Range): List[Text.Info[XML.Elem]] =
   {
     val results =
-      snapshot.cumulate[Vector[XML.Elem]](range, Vector.empty, Rendering.message_elements,
-        states =>
+      snapshot.cumulate[Vector[Command.Results.Entry]](
+        range, Vector.empty, Rendering.message_elements, command_states =>
           {
             case (res, Text.Info(_, elem)) =>
-              elem.markup.properties match {
-                case Markup.Serial(i) =>
-                  states.collectFirst(
-                  {
-                    case st if st.results.get(i).isDefined =>
-                      res :+ st.results.get(i).get
-                  })
-                case _ => None
-              }
+              Command.State.get_result_proper(command_states, elem.markup.properties)
+                .map(res :+ _)
             case _ => None
           })
 
     var seen_serials = Set.empty[Long]
-    def seen(elem: XML.Elem): Boolean =
-      elem.markup.properties match {
-        case Markup.Serial(i) => val b = seen_serials(i); seen_serials += i; b
-        case _ => false
-      }
+    def seen(i: Long): Boolean =
+    {
+      val b = seen_serials(i)
+      seen_serials += i
+      b
+    }
     for {
-      Text.Info(range, elems) <- results
-      elem <- elems
-      if !seen(elem)
+      Text.Info(range, entries) <- results
+      (i, elem) <- entries if !seen(i)
     } yield Text.Info(range, elem)
   }