src/Tools/VSCode/src/server.scala
changeset 64727 13e37567a0d6
parent 64725 38305f56c769
child 64733 20174e871623
equal deleted inserted replaced
64726:c534a2ac537d 64727:13e37567a0d6
   112 
   112 
   113   private val delay_input =
   113   private val delay_input =
   114     Standard_Thread.delay_last(options.seconds("vscode_input_delay"))
   114     Standard_Thread.delay_last(options.seconds("vscode_input_delay"))
   115     { resources.flush_input(session) }
   115     { resources.flush_input(session) }
   116 
   116 
   117   private val watcher = File_Watcher(sync_documents(_))
   117   private val delay_load =
       
   118     Standard_Thread.delay_last(options.seconds("vscode_load_delay"))
       
   119     { if (resources.resolve_dependencies(session)) delay_input.invoke() }
       
   120 
       
   121   private val watcher =
       
   122     File_Watcher(sync_documents(_), options.seconds("vscode_load_delay"))
   118 
   123 
   119   private def sync_documents(changed: Set[JFile]): Unit =
   124   private def sync_documents(changed: Set[JFile]): Unit =
   120     if (resources.sync_models(changed)) delay_input.invoke()
   125     if (resources.sync_models(changed)) delay_input.invoke()
   121 
   126 
   122   private def update_document(uri: String, text: String)
   127   private def update_document(uri: String, text: String)
   176     val try_session =
   181     val try_session =
   177       try {
   182       try {
   178         val content = Build.session_content(options, false, session_dirs, session_name)
   183         val content = Build.session_content(options, false, session_dirs, session_name)
   179         val resources =
   184         val resources =
   180           new VSCode_Resources(options, text_length, content.loaded_theories,
   185           new VSCode_Resources(options, text_length, content.loaded_theories,
   181             content.known_theories, content.syntax, log)
   186               content.known_theories, content.syntax, log) {
       
   187             override def commit(change: Session.Change): Unit =
       
   188               if (change.deps_changed) delay_load.invoke()
       
   189           }
   182 
   190 
   183         Some(new Session(resources) {
   191         Some(new Session(resources) {
   184           override def output_delay = options.seconds("editor_output_delay")
   192           override def output_delay = options.seconds("editor_output_delay")
   185           override def prune_delay = options.seconds("editor_prune_delay")
   193           override def prune_delay = options.seconds("editor_prune_delay")
   186           override def syslog_limit = options.int("editor_syslog_limit")
   194           override def syslog_limit = options.int("editor_syslog_limit")