浏览代码

HackStudio: Only send the content of open files to language server

When respawning the language server, we only need to send the content
of opened files to the server.

The on-disk content of files that are not currently open is up to
date, so the server can read them on its own.
Itamar 3 年之前
父节点
当前提交
28ff7d49ad
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Userland/DevTools/HackStudio/LanguageClient.cpp

+ 2 - 2
Userland/DevTools/HackStudio/LanguageClient.cpp

@@ -241,9 +241,9 @@ void ServerConnectionWrapper::try_respawn_connection()
     dbgln("Respawning ServerConnection");
     dbgln("Respawning ServerConnection");
     create_connection();
     create_connection();
 
 
-    // After respawning the language-server, we have to flush the content of the project files
+    // After respawning the language-server, we have to send the content of open project files
     // so the server's FileDB will be up-to-date.
     // so the server's FileDB will be up-to-date.
-    project().for_each_text_file([this](const ProjectFile& file) {
+    for_each_open_file([this](const ProjectFile& file) {
         if (file.code_document().language() != m_language)
         if (file.code_document().language() != m_language)
             return;
             return;
         m_connection->async_set_file_content(file.code_document().file_path(), file.document().text());
         m_connection->async_set_file_content(file.code_document().file_path(), file.document().text());