src/Pure/PIDE/resources.scala
changeset 66712 4c98c929a12a
parent 66701 d181f8a0e857
child 66713 afba7ffd6492
     1.1 --- a/src/Pure/PIDE/resources.scala	Thu Sep 28 11:53:55 2017 +0200
     1.2 +++ b/src/Pure/PIDE/resources.scala	Thu Sep 28 15:11:32 2017 +0200
     1.3 @@ -88,15 +88,14 @@
     1.4    def theory_qualifier(name: Document.Node.Name): String =
     1.5      session_base.global_theories.getOrElse(name.theory, Long_Name.qualifier(name.theory))
     1.6  
     1.7 -  def theory_name(qualifier: String, theory0: String): (Boolean, String) =
     1.8 -    session_base.loaded_theories.get(theory0) match {
     1.9 -      case Some(theory) => (true, theory)
    1.10 -      case None =>
    1.11 -        val theory =
    1.12 -          if (Long_Name.is_qualified(theory0) || session_base.global_theories.isDefinedAt(theory0))
    1.13 -            theory0
    1.14 -          else Long_Name.qualify(qualifier, theory0)
    1.15 -        (false, theory)
    1.16 +  def theory_name(qualifier: String, theory: String): (Boolean, String) =
    1.17 +    if (session_base.loaded_theory(theory)) (true, theory)
    1.18 +    else {
    1.19 +      val theory1 =
    1.20 +        if (Long_Name.is_qualified(theory) || session_base.global_theories.isDefinedAt(theory))
    1.21 +          theory
    1.22 +        else Long_Name.qualify(qualifier, theory)
    1.23 +      (false, theory1)
    1.24      }
    1.25  
    1.26    def import_name(qualifier: String, dir: String, s: String): Document.Node.Name =