src/Tools/jEdit/src/jedit_thy_load.scala
changeset 48883 04cd2fddb4d9
parent 48882 61dc7d5d150a
child 48885 d5fdaf7dd1f8
equal deleted inserted replaced
48882:61dc7d5d150a 48883:04cd2fddb4d9
    51       try { vfs._endVFSSession(session, view) }
    51       try { vfs._endVFSSession(session, view) }
    52       catch { case _: IOException => }
    52       catch { case _: IOException => }
    53     }
    53     }
    54   }
    54   }
    55 
    55 
    56   override def check_thy(name: Document.Node.Name): Document.Node.Header =
    56   override def check_thy(syntax: Outer_Syntax, name: Document.Node.Name)
       
    57     : Document.Node.Header =
    57   {
    58   {
    58     Swing_Thread.now {
    59     Swing_Thread.now {
    59       Isabelle.jedit_buffer(name.node) match {
    60       Isabelle.jedit_buffer(name.node) match {
    60         case Some(buffer) =>
    61         case Some(buffer) =>
    61           Isabelle.buffer_lock(buffer) {
    62           Isabelle.buffer_lock(buffer) {
    62             Some(check_thy_text(name, buffer.getSegment(0, buffer.getLength)))
    63             Some(check_thy_text(syntax, name, buffer.getSegment(0, buffer.getLength)))
    63           }
    64           }
    64         case None => None
    65         case None => None
    65       }
    66       }
    66     } getOrElse {
    67     } getOrElse {
    67       val file = new JFile(name.node)  // FIXME load URL via jEdit VFS (!?)
    68       val file = new JFile(name.node)  // FIXME load URL via jEdit VFS (!?)
    68       if (!file.exists || !file.isFile) error("No such file: " + quote(file.toString))
    69       if (!file.exists || !file.isFile) error("No such file: " + quote(file.toString))
    69       check_thy_text(name, File.read(file))
    70       check_thy_text(syntax, name, File.read(file))
    70     }
    71     }
    71   }
    72   }
    72 }
    73 }
    73 
    74