src/Tools/VSCode/src/server.scala
changeset 64727 13e37567a0d6
parent 64725 38305f56c769
child 64733 20174e871623
     1.1 --- a/src/Tools/VSCode/src/server.scala	Sat Dec 31 15:32:54 2016 +0100
     1.2 +++ b/src/Tools/VSCode/src/server.scala	Sat Dec 31 20:26:34 2016 +0100
     1.3 @@ -114,7 +114,12 @@
     1.4      Standard_Thread.delay_last(options.seconds("vscode_input_delay"))
     1.5      { resources.flush_input(session) }
     1.6  
     1.7 -  private val watcher = File_Watcher(sync_documents(_))
     1.8 +  private val delay_load =
     1.9 +    Standard_Thread.delay_last(options.seconds("vscode_load_delay"))
    1.10 +    { if (resources.resolve_dependencies(session)) delay_input.invoke() }
    1.11 +
    1.12 +  private val watcher =
    1.13 +    File_Watcher(sync_documents(_), options.seconds("vscode_load_delay"))
    1.14  
    1.15    private def sync_documents(changed: Set[JFile]): Unit =
    1.16      if (resources.sync_models(changed)) delay_input.invoke()
    1.17 @@ -178,7 +183,10 @@
    1.18          val content = Build.session_content(options, false, session_dirs, session_name)
    1.19          val resources =
    1.20            new VSCode_Resources(options, text_length, content.loaded_theories,
    1.21 -            content.known_theories, content.syntax, log)
    1.22 +              content.known_theories, content.syntax, log) {
    1.23 +            override def commit(change: Session.Change): Unit =
    1.24 +              if (change.deps_changed) delay_load.invoke()
    1.25 +          }
    1.26  
    1.27          Some(new Session(resources) {
    1.28            override def output_delay = options.seconds("editor_output_delay")