tuned signature;
authorwenzelm
Mon, 06 Nov 2017 17:24:09 +0100
changeset 67015 1a9e2a2bf251
parent 67014 e6a695d6a6b2
child 67016 57d58c3cf16b
tuned signature;
src/Pure/PIDE/resources.scala
src/Tools/VSCode/src/vscode_resources.scala
--- a/src/Pure/PIDE/resources.scala	Mon Nov 06 16:03:13 2017 +0100
+++ b/src/Pure/PIDE/resources.scala	Mon Nov 06 17:24:09 2017 +0100
@@ -19,8 +19,25 @@
 {
   resources =>
 
+
+  /* theory files */
+
   def thy_path(path: Path): Path = path.ext("thy")
 
+  def thy_node_name(qualifier: String, file: JFile, bootstrap: Boolean = false)
+    : Document.Node.Name =
+  {
+    session_base.known.get_file(file, bootstrap) getOrElse {
+      val node = file.getPath
+      theory_name(qualifier, Thy_Header.theory_name(node)) match {
+        case (true, theory) => Document.Node.Name.loaded_theory(theory)
+        case (false, theory) =>
+          val master_dir = if (theory == "") "" else file.getParent
+          Document.Node.Name(node, master_dir, theory)
+      }
+    }
+  }
+
 
   /* file-system operations */
 
--- a/src/Tools/VSCode/src/vscode_resources.scala	Mon Nov 06 16:03:13 2017 +0100
+++ b/src/Tools/VSCode/src/vscode_resources.scala	Mon Nov 06 17:24:09 2017 +0100
@@ -91,15 +91,7 @@
   def node_file(name: Document.Node.Name): JFile = new JFile(name.node)
 
   def node_name(file: JFile): Document.Node.Name =
-    session_base.known.get_file(file, bootstrap = true) getOrElse {
-      val node = file.getPath
-      theory_name(Sessions.DRAFT, Thy_Header.theory_name(node)) match {
-        case (true, theory) => Document.Node.Name.loaded_theory(theory)
-        case (false, theory) =>
-          val master_dir = if (theory == "") "" else file.getParent
-          Document.Node.Name(node, master_dir, theory)
-      }
-    }
+    thy_node_name(Sessions.DRAFT, file, bootstrap = true)
 
   override def append(dir: String, source_path: Path): String =
   {