check imports more strictly, e.g. reject ".../Pure" or ".../HOL-Library.Multiset";
--- a/src/Pure/PIDE/resources.ML Sat Sep 03 22:00:51 2022 +0200
+++ b/src/Pure/PIDE/resources.ML Sat Sep 03 22:25:22 2022 +0200
@@ -287,6 +287,11 @@
let
val theory = theory_name qualifier (Thy_Header.import_name s);
fun theory_node path = make_theory_node path theory;
+ val literal_import = literal_theory theory andalso qualifier <> theory_qualifier theory;
+ val _ =
+ if literal_import andalso not (Thy_Header.is_base_name s) then
+ error ("Bad import of theory from other session via file-path: " ^ quote s)
+ else ();
in
if loaded_theory theory then loaded_theory_node theory
else
--- a/src/Pure/PIDE/resources.scala Sat Sep 03 22:00:51 2022 +0200
+++ b/src/Pure/PIDE/resources.scala Sat Sep 03 22:25:22 2022 +0200
@@ -171,6 +171,11 @@
def import_name(qualifier: String, dir: String, s: String): Document.Node.Name = {
val theory = theory_name(qualifier, Thy_Header.import_name(s))
+ val literal_import =
+ literal_theory(theory) && qualifier != sessions_structure.theory_qualifier(theory)
+ if (literal_import && !Thy_Header.is_base_name(s)) {
+ error("Bad import of theory from other session via file-path: " + quote(s))
+ }
if (session_base.loaded_theory(theory)) loaded_theory_node(theory)
else {
find_theory_node(theory) match {