equal
deleted
inserted
replaced
19 import scala.collection.mutable |
19 import scala.collection.mutable |
20 |
20 |
21 |
21 |
22 object Server |
22 object Server |
23 { |
23 { |
|
24 type Editor = isabelle.Editor[Unit] |
|
25 |
|
26 |
24 /* Isabelle tool wrapper */ |
27 /* Isabelle tool wrapper */ |
25 |
28 |
26 private lazy val default_logic = Isabelle_System.getenv("ISABELLE_LOGIC") |
29 private lazy val default_logic = Isabelle_System.getenv("ISABELLE_LOGIC") |
27 |
30 |
28 val isabelle_tool = Isabelle_Tool("vscode_server", "VSCode Language Server for PIDE", args => |
31 val isabelle_tool = Isabelle_Tool("vscode_server", "VSCode Language Server for PIDE", args => |
116 Standard_Thread.delay_last(options.seconds("vscode_input_delay"), channel.Error_Logger) |
119 Standard_Thread.delay_last(options.seconds("vscode_input_delay"), channel.Error_Logger) |
117 { resources.flush_input(session) } |
120 { resources.flush_input(session) } |
118 |
121 |
119 private val delay_load: Standard_Thread.Delay = |
122 private val delay_load: Standard_Thread.Delay = |
120 Standard_Thread.delay_last(options.seconds("vscode_load_delay"), channel.Error_Logger) { |
123 Standard_Thread.delay_last(options.seconds("vscode_load_delay"), channel.Error_Logger) { |
121 val (invoke_input, invoke_load) = resources.resolve_dependencies(session, file_watcher) |
124 val (invoke_input, invoke_load) = |
|
125 resources.resolve_dependencies(session, editor, file_watcher) |
122 if (invoke_input) delay_input.invoke() |
126 if (invoke_input) delay_input.invoke() |
123 if (invoke_load) delay_load.invoke |
127 if (invoke_load) delay_load.invoke |
124 } |
128 } |
125 |
129 |
126 private val file_watcher = |
130 private val file_watcher = |
156 norm(rest2) |
160 norm(rest2) |
157 } |
161 } |
158 } |
162 } |
159 norm(changes) |
163 norm(changes) |
160 norm_changes.foreach(change => |
164 norm_changes.foreach(change => |
161 resources.change_model(session, file, change.text, change.range)) |
165 resources.change_model(session, editor, file, change.text, change.range)) |
162 |
166 |
163 delay_input.invoke() |
167 delay_input.invoke() |
164 delay_output.invoke() |
168 delay_output.invoke() |
165 } |
169 } |
166 |
170 |
428 } |
432 } |
429 |
433 |
430 |
434 |
431 /* abstract editor operations */ |
435 /* abstract editor operations */ |
432 |
436 |
433 object editor extends Editor[Unit] |
437 object editor extends Server.Editor |
434 { |
438 { |
435 override def session: Session = server.session |
439 override def session: Session = server.session |
436 override def flush(): Unit = resources.flush_input(session) |
440 override def flush(): Unit = resources.flush_input(session) |
437 override def invoke(): Unit = delay_input.invoke() |
441 override def invoke(): Unit = delay_input.invoke() |
438 |
442 |