clarified signature;
authorwenzelm
Thu, 30 Aug 2018 17:24:43 +0200
changeset 68857 b888de4fe58c
parent 68856 e5097a5b2e58
child 68858 e1796b8ddbae
clarified signature;
src/Pure/PIDE/document.scala
--- a/src/Pure/PIDE/document.scala	Thu Aug 30 14:56:04 2018 +0200
+++ b/src/Pure/PIDE/document.scala	Thu Aug 30 17:24:43 2018 +0200
@@ -706,14 +706,16 @@
     def the_dynamic_state(id: Document_ID.Exec): Command.State = execs.getOrElse(id, fail)
     def the_assignment(version: Version): State.Assignment = assignments.getOrElse(version.id, fail)
 
+    def lookup_id(id: Document_ID.Generic): Option[Command.State] =
+      commands.get(id) orElse execs.get(id)
+
     private def self_id(st: Command.State)(id: Document_ID.Generic): Boolean =
       id == st.command.id ||
       (execs.get(id) match { case Some(st1) => st1.command.id == st.command.id case None => false })
 
     private def other_id(id: Document_ID.Generic)
       : Option[(Symbol.Text_Chunk.Id, Symbol.Text_Chunk)] =
-      (execs.get(id) orElse commands.get(id)).map(st =>
-        ((Symbol.Text_Chunk.Id(st.command.id), st.command.chunk)))
+      lookup_id(id).map(st => ((Symbol.Text_Chunk.Id(st.command.id), st.command.chunk)))
 
     private def redirection(st: Command.State): Graph[Document_ID.Command, Unit] =
       (commands_redirection /: st.markups.redirection_iterator)({ case (graph, id) =>
@@ -1077,7 +1079,7 @@
         /* find command */
 
         def find_command(id: Document_ID.Generic): Option[(Node, Command)] =
-          state.commands.get(id) orElse state.execs.get(id) match {
+          state.lookup_id(id) match {
             case None => None
             case Some(st) =>
               val command = st.command