src/Tools/jEdit/src/jedit/isabelle_sidekick.scala
changeset 38569 9d480f6a2589
parent 38564 a6e2715fac5f
child 38577 4e4d3ea3725a
equal deleted inserted replaced
38568:f117ba49a59c 38569:9d480f6a2589
    70 
    70 
    71     val line = buffer.getLineOfOffset(caret)
    71     val line = buffer.getLineOfOffset(caret)
    72     val start = buffer.getLineStartOffset(line)
    72     val start = buffer.getLineStartOffset(line)
    73     val text = buffer.getSegment(start, caret - start)
    73     val text = buffer.getSegment(start, caret - start)
    74 
    74 
    75     val completion = Isabelle.session.current_syntax.completion
    75     val completion = Isabelle.session.current_syntax().completion
    76 
    76 
    77     completion.complete(text) match {
    77     completion.complete(text) match {
    78       case None => null
    78       case None => null
    79       case Some((word, cs)) =>
    79       case Some((word, cs)) =>
    80         val ds =
    80         val ds =
    95     import Isabelle_Sidekick.int_to_pos
    95     import Isabelle_Sidekick.int_to_pos
    96 
    96 
    97     val root = data.root
    97     val root = data.root
    98     val snapshot = Swing_Thread.now { model.snapshot() }  // FIXME cover all nodes (!??)
    98     val snapshot = Swing_Thread.now { model.snapshot() }  // FIXME cover all nodes (!??)
    99     for {
    99     for {
   100       (command, command_start) <- snapshot.node.command_range(0)
   100       (command, command_start) <- snapshot.node.command_range()
   101       if command.is_command && !stopped
   101       if command.is_command && !stopped
   102     }
   102     }
   103     {
   103     {
   104       val name = command.name
   104       val name = command.name
   105       val node =
   105       val node =
   126   {
   126   {
   127     import Isabelle_Sidekick.int_to_pos
   127     import Isabelle_Sidekick.int_to_pos
   128 
   128 
   129     val root = data.root
   129     val root = data.root
   130     val snapshot = Swing_Thread.now { model.snapshot() }  // FIXME cover all nodes (!??)
   130     val snapshot = Swing_Thread.now { model.snapshot() }  // FIXME cover all nodes (!??)
   131     for ((command, command_start) <- snapshot.node.command_range(0) if !stopped) {
   131     for ((command, command_start) <- snapshot.node.command_range() if !stopped) {
   132       snapshot.state(command).markup_root.swing_tree(root)((node: Markup_Tree.Node[Any]) =>
   132       snapshot.state(command).markup_root.swing_tree(root)((node: Markup_Tree.Node[Any]) =>
   133           {
   133           {
   134             val content = command.source(node.range).replace('\n', ' ')
   134             val content = command.source(node.range).replace('\n', ' ')
   135             val id = command.id
   135             val id = command.id
   136 
   136