src/Pure/Tools/scala_project.scala
changeset 72755 8dffbe01a3e1
parent 72748 04d5f6d769a7
child 72762 d9a54c4c9da9
equal deleted inserted replaced
72754:1456c5747416 72755:8dffbe01a3e1
    58       "src/Tools/VSCode/" -> Path.explode("isabelle.vscode"),
    58       "src/Tools/VSCode/" -> Path.explode("isabelle.vscode"),
    59       "src/Tools/jEdit/src-base/" -> Path.explode("isabelle.jedit_base"),
    59       "src/Tools/jEdit/src-base/" -> Path.explode("isabelle.jedit_base"),
    60       "src/Tools/jEdit/src/" -> Path.explode("isabelle.jedit"),
    60       "src/Tools/jEdit/src/" -> Path.explode("isabelle.jedit"),
    61       "src/HOL/SPARK/Tools" -> Path.explode("isabelle.spark"),
    61       "src/HOL/SPARK/Tools" -> Path.explode("isabelle.spark"),
    62       "src/HOL/Tools/Nitpick" -> Path.explode("isabelle.nitpick"))
    62       "src/HOL/Tools/Nitpick" -> Path.explode("isabelle.nitpick"))
       
    63 
       
    64 
       
    65   /* compile-time position */
       
    66 
       
    67   def here: Here =
       
    68   {
       
    69     val exn = new Exception
       
    70     exn.getStackTrace.toList match {
       
    71       case _ :: caller :: _ =>
       
    72         val name = proper_string(caller.getFileName).getOrElse("")
       
    73         val line = caller.getLineNumber
       
    74         new Here(name, line)
       
    75       case _ => new Here("", 0)
       
    76     }
       
    77   }
       
    78 
       
    79   class Here private[Scala_Project](name: String, line: Int)
       
    80   {
       
    81     override def toString: String = name + ":" + line
       
    82     def position: Position.T =
       
    83     {
       
    84       if (name.startsWith("<")) Position.none
       
    85       else {
       
    86         val suffix = "/" + name
       
    87         isabelle_files().find(_.endsWith(suffix)) match {
       
    88           case None => Position.none
       
    89           case Some(file) => Position.Line_File(line, "$ISABELLE_HOME/" + file)
       
    90         }
       
    91       }
       
    92     }
       
    93   }
    63 
    94 
    64 
    95 
    65   /* scala project */
    96   /* scala project */
    66 
    97 
    67   def scala_project(project_dir: Path, symlinks: Boolean = false)
    98   def scala_project(project_dir: Path, symlinks: Boolean = false)