summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorItamar <itamar8910@gmail.com>2021-12-03 09:45:23 +0200
committerAndreas Kling <kling@serenityos.org>2021-12-03 15:38:21 +0100
commit28ff7d49ad29cf71d8e6cd6cf516a8f3c673616c (patch)
tree09e603f573761385ac7c73f8e4d5bb37a870b427 /Userland
parent3e9a96f1d8e5037ea164f1c180853d5366880083 (diff)
downloadserenity-28ff7d49ad29cf71d8e6cd6cf516a8f3c673616c.zip
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.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/DevTools/HackStudio/LanguageClient.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/DevTools/HackStudio/LanguageClient.cpp b/Userland/DevTools/HackStudio/LanguageClient.cpp
index a4842fe87a..28ee936889 100644
--- a/Userland/DevTools/HackStudio/LanguageClient.cpp
+++ b/Userland/DevTools/HackStudio/LanguageClient.cpp
@@ -241,9 +241,9 @@ void ServerConnectionWrapper::try_respawn_connection()
dbgln("Respawning ServerConnection");
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.
- project().for_each_text_file([this](const ProjectFile& file) {
+ for_each_open_file([this](const ProjectFile& file) {
if (file.code_document().language() != m_language)
return;
m_connection->async_set_file_content(file.code_document().file_path(), file.document().text());