tuned signature: more operations;
authorwenzelm
Sun, 02 Nov 2025 15:53:25 +0100
changeset 83453 d9059089359b
parent 83452 1cd0ab0ccb9d
child 83454 62178604511c
tuned signature: more operations;
src/Pure/PIDE/query_operation.scala
--- a/src/Pure/PIDE/query_operation.scala	Sun Nov 02 15:53:04 2025 +0100
+++ b/src/Pure/PIDE/query_operation.scala	Sun Nov 02 15:53:25 2025 +0100
@@ -191,16 +191,20 @@
     }
   }
 
-  def locate_query(): Unit = {
-    editor.require_dispatcher {}
+  def query_command(): Option[(Document.Snapshot, Command)] =
+    editor.require_dispatcher {
+      val state = current_state.value
+      for {
+        command <- state.location
+        snapshot = editor.node_snapshot(command.node_name) if !snapshot.is_outdated
+      } yield (snapshot, command)
+    }
 
-    val state = current_state.value
+  def locate_query(): Unit =
     for {
-      command <- state.location
-      snapshot = editor.node_snapshot(command.node_name)
+      (snapshot, command) <- query_command()
       link <- editor.hyperlink_command(true, snapshot, command.id)
     } link.follow(editor_context)
-  }
 
 
   /* main */